From owner-freebsd-hackers Sat Nov 16 14:13:55 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id OAA23706 for hackers-outgoing; Sat, 16 Nov 1996 14:13:55 -0800 (PST) Received: from sumatra.americantv.com (sumatra.americantv.com [199.184.181.250]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id OAA23701 for ; Sat, 16 Nov 1996 14:13:37 -0800 (PST) Received: from right.PCS (right.pcs. [148.105.10.31]) by sumatra.americantv.com (8.7.6/8.7.3) with ESMTP id PAA14278; Sat, 16 Nov 1996 15:34:13 -0600 (CST) Received: (jlemon@localhost) by right.PCS (8.6.13/8.6.4) id WAA05401; Sat, 16 Nov 1996 22:11:37 GMT Message-Id: <199611162211.WAA05401@right.PCS> Date: Sat, 16 Nov 1996 16:11:36 -0600 From: jlemon@americantv.com (Jonathan Lemon) To: scrappy@ki.net (Marc G. Fournier) Cc: hackers@FreeBSD.org Subject: Re: Hate to ask more about sockets...but... References: X-Mailer: Mutt 0.48.1 Mime-Version: 1.0 In-Reply-To: ; from Marc G. Fournier on Nov 16, 1996 15:13:04 -0500 Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk > Great, this works...sort of. For some reason, the program reports that the > read completed correctly, with the exact number of bytes read as I wrote to > the socket, but I'm missing several lines out of the graphic when I view it. > (check out http://www.ki.net/~scrappy/test.html, if you want to see what I > mean by "missing several lines") > > If I change 'cnt' in the server to be 2 instead of 1, the graphic will come > out completely...as if, for some reason, the last read didn't get written to > the screen if it only 'scans' the file once. > > The other thing I found was weird was that if I changed the 'break' in > the client side to a 'continue', so that it continued to scan the input > socket for data (ie. await the next image to be send down the socket), I > lost even more data from the image. It sounds almost if your client is buffering it's output writes, and that you aren't flushing the buffer before the client exits. I cobbled up a quick client/server example with the above code, and it doesn't seem to have any problems transferring data back and forth. (e-mail me if you want the code). -- Jonathan