Hi Yi Bing,
you could override TCPSelectorHandler :
TCPSelectorHandler sh = new TCPSelectorHandler() {
public boolean onAcceptInterest(SelectionKey key, Context ctx) throws IOException {
SelectableChannel channel = acceptWithoutRegistration(key);
if (channel != null) {
configureChannel(channel);
SelectionKey readKey =
channel.register(selector, SelectionKey.OP_WRITE);
readKey.attach(System.currentTimeMillis());
}
return false;
}
};
sh.setPort(serverPort);
controller.setSelectorHandler(sh);
Is that what you wanted?
many greetings
John
--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser