Detecting remote NIO sockets closed

Stanley Brown stanley.brown@zimmer.com
Mon Sep 20 13:39:00 GMT 2004


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.



More information about the Java mailing list