From owner-freebsd-hackers Mon Aug 17 06:49:26 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA07842 for freebsd-hackers-outgoing; Mon, 17 Aug 1998 06:49:26 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA07837 for ; Mon, 17 Aug 1998 06:49:24 -0700 (PDT) (envelope-from root@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id GAA19588; Mon, 17 Aug 1998 06:48:03 -0700 (PDT) Message-Id: <199808171348.GAA19588@implode.root.com> To: Didier Derny cc: hackers@FreeBSD.ORG Subject: Re: Yard/FreeBSD Problem (fwd) In-reply-to: Your message of "Mon, 17 Aug 1998 14:18:01 +0200." From: David Greenman Reply-To: dg@root.com Date: Mon, 17 Aug 1998 06:48:03 -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >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