directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject Re: Serverside NIO: Not ready for Prime Time
Date Wed, 26 Nov 2003 01:25:21 GMT
On Wed, 26 Nov 2003 03:13 am, Wes McKean wrote:
> The CancelledKeyException seems to be happing because I am removing the
> SelectionKey from the iterator.  The other error seems to occur when I have
> multiple reads and writes going on with different SocketChannels.  Here is
> the exception:

I think some of problems will be that you are processing the channels in 
different threads from the select. I can not see a good reason for this. 
Would it not be better to do the reads in the same thread as the selector, 
buffer the data and then send an event that is processed in another thread.

See attached files for the sort of thing I mean. Associated with each 
connection object I have a TcpTransport object. The selector threads does all 
the nbio and then sends event to "parsing" stage. This seems to work like a 

Anyways you may want to check out the spice/sandbox/sca project at as it contains code that simplifies working with 
selectors etc. 


Peter Donald
I think the next best thing to solving a 
problem is finding some humor in it. 
                - Frank A. Clark 

View raw message