Niklas Therning wrote:
>...
>
>One thing I'm not sure of is what happens to the readyOps if you change
>the interestOps during the same select-iteration? Will isReadable be
>false if I first mask out OP_READ in the interestOps right before
>processSessions() is called? If this isn't the case I guess my patch
>won't work without some changes.
>
>
>
The following additional change to SocketIoProcessor would be required
if interestOps doesn't change readyOps:
@@ -233,12 +286,13 @@
SelectionKey key = ( SelectionKey ) it.next();
SocketSessionImpl session = ( SocketSessionImpl )
key.attachment();
- if( key.isReadable() )
+ int mask = session.getInterestOpsMask();
+ if( (mask & SelectionKey.OP_READ) > 0 && key.isReadable() )
{
read( session );
}
- if( key.isWritable() )
+ if( (mask & SelectionKey.OP_WRITE) > 0 && key.isWritable() )
{
scheduleFlush( session );
}
WDYT?
Regards,
Niklas Therning