INT-1346 Testing Timing Problem - isListening() returned true a little too soon.

This commit is contained in:
Gary Russell
2010-08-23 18:39:46 +00:00
parent 2c7b57448b
commit 971e5dc465

View File

@@ -69,7 +69,6 @@ public class TcpNioServerConnectionFactory extends AbstractServerConnectionFacto
}
try {
this.serverChannel = ServerSocketChannel.open();
this.listening = true;
logger.info("Listening on port " + this.port);
this.serverChannel.configureBlocking(false);
if (this.localAddress == null) {
@@ -82,6 +81,7 @@ public class TcpNioServerConnectionFactory extends AbstractServerConnectionFacto
}
final Selector selector = Selector.open();
this.serverChannel.register(selector, SelectionKey.OP_ACCEPT);
this.listening = true;
doSelect(this.serverChannel, selector);
} catch (IOException e) {