Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Nov 1996 17:44:27 -0500 (EST)
From:      "Marc G. Fournier" <scrappy@ki.net>
To:        Jonathan Lemon <jlemon@americantv.com>
Cc:        hackers@FreeBSD.org
Subject:   Re: Hate to ask more about sockets...but...
Message-ID:  <Pine.NEB.3.95.961116174126.8661A-100000@quagmire.ki.net>
In-Reply-To: <199611162211.WAA05401@right.PCS>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 16 Nov 1996, Jonathan Lemon wrote:

> > 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).

	One of the things I thought about after sending out the original is
that since it is a blocked read, that the last packet, which is <4096, is
taking too long to return...I'm going to attempt making it a non-blocking
read instead, and see if that fixes the problem.  It always seems to be
the last read that goes missing...

Marc G. Fournier                                  scrappy@ki.net
Systems Administrator @ ki.net               scrappy@freebsd.org




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.95.961116174126.8661A-100000>