From owner-freebsd-hackers Thu Nov 14 16:23:46 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id QAA26394 for hackers-outgoing; Thu, 14 Nov 1996 16:23:46 -0800 (PST) Received: from quagmire.ki.net (root@quagmire.ki.net [205.150.102.1]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id QAA26386 for ; Thu, 14 Nov 1996 16:23:42 -0800 (PST) Received: from localhost (scrappy@localhost) by quagmire.ki.net (8.8.2/8.7.5) with SMTP id TAA13074; Thu, 14 Nov 1996 19:22:09 -0500 (EST) Date: Thu, 14 Nov 1996 19:22:08 -0500 (EST) From: "Marc G. Fournier" To: John Polstra cc: Joe Greco , hackers@FreeBSD.org Subject: Re: Sockets question... In-Reply-To: <199611150002.QAA10843@austin.polstra.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk On Thu, 14 Nov 1996, John Polstra wrote: > > > Are you checking the return value from write() to make sure it actually > > > thinks that N bytes were _written_? > > > > > *sigh* > > Well now, wait a minute. As long as you haven't set the socket for > non-blocking I/O, the write will always block until it's written the > full N bytes that you asked for. In other words, the write will always > return either -1 or N. Only if it's set up for non-blocking I/O can it > return a short count. Writes are different from reads in this respect. > Oh good, that's what *I* thought...but since I'm totally new to socket programming...I foolishly didn't question :) Marc G. Fournier scrappy@ki.net Systems Administrator @ ki.net scrappy@freebsd.org