This is a pretty straightforward question, but I found it necessary to unregister a selector that does not see my socket channel for java.
SocketChannel client = myServer.accept(); //forks off another client socket client.configureBlocking(false);//this channel takes in multiple request client.register(mySelector, SelectionKey.OP_READ | SelectionKey.OP_WRITE);//changed from r to rw
Where can I call something like this later in the program
client.deregister(mySelector);
And that the selector will no longer capture data keys for this socket channel. This would make life a lot easier for me, given my server / client design.
java select nonblocking sockets socketchannel
Dr.Knowitall
source share