From 971e5dc46502c2283d3d105c7ae366985fd0cb5a Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Mon, 23 Aug 2010 18:39:46 +0000 Subject: [PATCH] INT-1346 Testing Timing Problem - isListening() returned true a little too soon. --- .../ip/tcp/connection/TcpNioServerConnectionFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioServerConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioServerConnectionFactory.java index abb5ae4bfb..8e513eb0c6 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioServerConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioServerConnectionFactory.java @@ -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) {