Date: Tue, 16 Mar 1999 21:08:58 -0800 (PST) From: boards yan <boardyan@yahoo.com> To: freebsd-net@FreeBSD.ORG Subject: exhausted Message-ID: <19990317050858.7049.rocketmail@web704.mail.yahoo.com>
next in thread | raw e-mail | index | archive | help
Hi,
I tried to set the tcp socket Option(SO_RCV,TCP_MAXSEG), but failed
all the time.
The program seems quite normal.
However, the supervision using tcpdump shows that
the option is unchanged. :-(
Can anybody give me a reason?
B.R.
-------------------------------------------------
{ int number=512,n,optlen;
struct protoent *p;
p = getprotobyname("tcp");
if( p && setsockopt(fd, p->p_proto, TCP_MAXSEG, &number,
sizeof(one)) < 0)
err("setsockopt: MAXSEG");
optlen=sizeof(n);
if (getsockopt(fd, p->p_proto, TCP_MAXSEG, (char*) &n,
&optlen)<0)
err("getsockopt: MAXSEG-getsockopt");
fprintf(stderr,"\n MAXSEG set to %d",n);
}
----------------------------------------------------
if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char*) &sockbufsize,
sizeof(sockbufsize)) < 0)
perror("setsockopt: rcvbuf");
{
int n;
int optlen;
optlen=sizeof(n);
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char*) &n,
&optlen)<0)
perror("getsockopt");
if (n!=sockbufsize)
printf("\n revbuff not set correctly");
else
printf("\n buffer set to %d",n);
}
----------------------------------------------------
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990317050858.7049.rocketmail>
