directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wes McKean <>
Subject Re: Serverside NIO: Not ready for Prime Time
Date Tue, 25 Nov 2003 16:13:00 GMT
If you want to look at my code, check out the nio sub project under sandbox0 
on the site.  To recap at a high level here, I am:

1.  Creating a non blocking server socket which waits for connect events.  
Once a connect event occurs, the resulting SocketChannel is accepted and 
passed off to the input manager.

2.  The InputManager makes the SocketChannel non-blocking, then registers it 
for READ events with its Selector.  This occurs in two different threads 
( the registration and the selecting ).

3.  When a read event occurs, I do the usual.  I get the selected keys, get an 
iterator, process them one at a time, removing them as I do, then loop back 
around to select again.

I am getting two errors, a NullPointerException, and a CancelledKeyException.  

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:




On Tuesday 25 November 2003 08:38 am, Peter Donald wrote:
> On Tue, 25 Nov 2003 11:56 pm, Wes McKean wrote:
> > I was running ldapd on a Windows XP box with  the new server side NIO
> > stuff included, and I was getting all kinds of weird messages inside the
> > sun implementation classes.  The same exact code works fine under Linux. 
> > It is my professional opinion that there are some issues with the Windows
> > XP implementation of non-blocking sockets, and we couldn't put this stuff
> > into the server until these issues are addressed.
> There are a large number of platform specific issues - but that is no
> different from differences between pre-nio sockets on linux and windows. I
> have been building a NIO based network layer recently so if you describe
> some of the exact issues then I may be able to show how to avoid or give
> code to do just that.

View raw message