Request for review / feedback: SocketChannel.poll()

Alan Bateman Alan.Bateman at oracle.com
Wed Oct 2 20:18:58 PDT 2013


On 02/10/2013 14:03, David M. Lloyd wrote:
> :
>
> 1. Thread interruption should stop the poll, but absolutely should not 
> *not* close the channel - that was a bad idea at its inception and it 
> is still a bad idea now, and people who do not want this behavior (== 
> sane people) will still be stuck with using temporary selectors.  It 
> is up to the application to decide what thread interruption means. 
> InterruptedIOException is more appropriate, and the user can elect to 
> close the channel if they feel it is appropriate to do so. 
> Inconsistency is worthless if the existing behavior does not make sense.
You are correct that there is a bug in the proposal as the poll is 
supposed to behave in the same way as Selector.select when interrupted 
(which means it is supposed to wakeup the poll).

I don't have time to debate your comments on InterruptedIOException as 
that was totally broken, we don't want to go back there.

-Alan.


More information about the nio-dev mailing list