On Tue, 14 May 2013 00:26:08 GMT, punkUser wrote:

To be slightly more clear on the issue...

Given a stream returned from a listen, after a bit of handshaking:

dataavailablefor_read seems to always return false

When you did the busy-looping, die you call yield() inside? Since dataAvailableForRead is s non-blocking function, it needs something to keep the event loop going or nothing will arrive.

read() blocks and work as expected, but does not return on remote disconnect (just keeps waiting)
stream.connected seems to always return true

If you look at the output with the highest verbosity level (--vvvv or LogLevel.trace), does it print anything about "Socket event on fd ..." or "Connection was closed"? It's in libevent2_tcp.d/onSocketEvent where the path of execution should lead to lines 531, 549 and 557 if everything goes right.

... and I've just discovered that line 561 resumes the wrong task (fixed now, could be related, but more in the case of write() instead of read()).