http://qs321.pair.com?node_id=1173876


in reply to Re^10: sysread/syswrite wrappers
in thread sysread/syswrite wrappers

So you have data to read, but select tells that you don't.

Hm. This is a simple server, using non-block sockets, select and readline.

It reads one line every 1/10th second ensuring the client will have finished and closed its end of the socket long before the server has read the first buffer load:

And here a simple client that connects, writes 1 full 4k buffer load, then 2k and a distinct last line.

If the select was returning eof before the buffer was emptied, you wouldn't see the distinct last line; but I always do!:

Perhaps you can tell me what I'm doing 'wrong' to make it work? Or maybe the behaviour you describe is just a *nix thing.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.