From owner-freebsd-questions Wed Feb 2 7:50:20 2000 Delivered-To: freebsd-questions@freebsd.org Received: from css-1.cs.iastate.edu (css-1.cs.iastate.edu [129.186.3.24]) by builder.freebsd.org (Postfix) with ESMTP id E1CA23FF7 for ; Wed, 2 Feb 2000 07:50:16 -0800 (PST) Received: from popeye.cs.iastate.edu (ghelmer@popeye.cs.iastate.edu [129.186.3.4]) by css-1.cs.iastate.edu (8.9.0/8.9.0) with ESMTP id JAA08314; Wed, 2 Feb 2000 09:50:13 -0600 (CST) Received: from localhost (ghelmer@localhost) by popeye.cs.iastate.edu (8.9.0/8.9.0) with ESMTP id JAA26905; Wed, 2 Feb 2000 09:50:10 -0600 (CST) X-Authentication-Warning: popeye.cs.iastate.edu: ghelmer owned process doing -bs Date: Wed, 2 Feb 2000 09:50:09 -0600 (CST) From: Guy Helmer To: Sebastiaan van Erk Cc: freebsd-questions@FreeBSD.ORG Subject: Re: TCP_NODELAY In-Reply-To: <20000202145409.225685DC3@eeyore.sebster.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 2 Feb 2000, Sebastiaan van Erk wrote: > Hi there, > > I tried the following code to disable Nagle's algorithm, but it doesn't > seem to work: > > int d = 1; > setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (void *)&d, sizeof(d)); > > ... > > My OS is FreeBSD 3.4 STABLE. If I compile the program under Linux, > Solaris, or HP-UX, it works fine. > > I attached both the C program and the Java program which I use to test > the TCP_NODELAY settings. FreeBSD does not propagate the TCP_NODELAY flag from a listening socket to the accepted sockets. Your code needs to perform a setsockopt on the accepted socket (sendskt in your tcpdelay.c file) for the Nagle algorithm to be disabled. (The FreeBSD mail list archives contain a thread on this very topic if you want to explore previous questions and responses.) Guy Guy Helmer, Ph.D. Candidate, Iowa State University Dept. of Computer Science Research Assistant, Dept. of Computer Science --- ghelmer@cs.iastate.edu http://www.cs.iastate.edu/~ghelmer To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message