Date: Mon, 17 Aug 1998 06:48:03 -0700 From: David Greenman <dg@root.com> To: Didier Derny <didier@omnix.net> Cc: hackers@FreeBSD.ORG Subject: Re: Yard/FreeBSD Problem (fwd) Message-ID: <199808171348.GAA19588@implode.root.com> In-Reply-To: Your message of "Mon, 17 Aug 1998 14:18:01 %2B0200." <Pine.BSF.3.96.980817141225.25770A-100000@omnix.net>
next in thread | previous in thread | raw e-mail | index | archive | help
>and this is the server: > >=============================== > > if ((s = socket(AF_INET,SOCK_STREAM,0)) < 0) > { > fprintf(stderr,"server: socket() failed. errno = %d\n",errno); > netlog("server: socket() failed. errno = %d\n",errno); > exit(1); > } > > if ((sopt = getenv("YARDTCPNODELAY"))) > { > int flag = 1; > > printf("Using socket option TCP_NODELAY to %d\n",flag); > if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY,(char*)&flag,sizeof(i >nt)) < 0) > { > fprintf(stderr,"server: setsockopt() failed. errno = %d\ >n",errno); > netlog("server: setsockopt() failed. errno = %d\n",errno >); > } > } For the server, "s" above appears to be the unconnected (listen) socket. The TCP_NODELAY option is not propagated across to accept()ed sockets, so you must do the setsockopt on those, not on the listen socket. -DG David Greenman Co-founder/Principal Architect, The FreeBSD Project To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808171348.GAA19588>