Detecting remote NIO sockets closed

Michael Koch konqueror@gmx.de
Mon Sep 20 14:09:00 GMT 2004


On Monday 20 September 2004 15:39, Stanley Brown wrote:
> David Daney wrote:
> >Stanley Brown wrote:
> >>Found another NIO sockets issue.  For some reason an OP_READ
> >> event is never issued when a non-blocking socket has concluded. 
> >> This is a problem because, from my understanding, the only way
> >> to know you've
> >
> >Reads are usless for detecting connections that have not
> > terminated "normally".  Doing a write is the only reliable method
> > for determining that a connection is still "open".
>
> I'm not looking for abnormal connection terminations.  For now I'm
> only concerned with getting non-blocking nio sockets to behave like
> Sun's implementation in that a closing socket adds a OP_READ event
> to the interested selector and further reads will result in -1
> bytes being available.

Sorry for not asnwering earlier. I just look into your problem.
I think I will have a solution tomorrow (if real life allows ...).


Michael



More information about the Java mailing list