From owner-freebsd-hackers Thu Nov 14 13:12:30 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA06097 for hackers-outgoing; Thu, 14 Nov 1996 13:12:30 -0800 (PST) Received: from who.cdrom.com (who.cdrom.com [204.216.27.3]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id NAA06063 for ; Thu, 14 Nov 1996 13:12:24 -0800 (PST) Received: from quagmire.ki.net (root@quagmire.ki.net [205.150.102.1]) by who.cdrom.com (8.7.5/8.6.11) with ESMTP id NAA00566 for ; Thu, 14 Nov 1996 13:12:16 -0800 (PST) Received: from localhost (scrappy@localhost) by quagmire.ki.net (8.8.2/8.7.5) with SMTP id QAA09013; Thu, 14 Nov 1996 16:10:36 -0500 (EST) Date: Thu, 14 Nov 1996 16:10:34 -0500 (EST) From: "Marc G. Fournier" To: John Polstra cc: hackers@freebsd.org Subject: Re: Sockets question... In-Reply-To: <199611141954.LAA09643@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: > In general, a read() on a socket will return as soon as _any_ data is > available -- even just 1 byte. > > Could this be the problem? > Ack...that sounds like exactly the problem...I misunderstood the read() call :( Why does 512k work fine though? no data lose at all.... I'm going to code in your suggestion above, but I'm very curious now as to why 512bytes and 80bytes both work cleanly, but 256bytes "loses" data... I think I'm just going to *borrow* the readn/writen functions from the book to avoid making this foolish mistake again :) Thanks... Marc G. Fournier scrappy@ki.net Systems Administrator @ ki.net scrappy@freebsd.org