Updated Branches: refs/heads/trunk 06bac93f2 -> 5f337262f
removed some useless refrence to last socket connection Project: http://git-wip-us.apache.org/repos/asf/mina/repo Commit: http://git-wip-us.apache.org/repos/asf/mina/commit/5f337262 Tree: http://git-wip-us.apache.org/repos/asf/mina/tree/5f337262 Diff: http://git-wip-us.apache.org/repos/asf/mina/diff/5f337262 Branch: refs/heads/trunk Commit: 5f337262fb4bfd740bf939dc99c034460b9dbd08 Parents: 06bac93 Author: jvermillard <[email protected]> Authored: Sat May 11 21:15:12 2013 +0200 Committer: jvermillard <[email protected]> Committed: Sat May 11 21:15:12 2013 +0200 ---------------------------------------------------------------------- .../mina/transport/nio/tcp/NioTcpClient.java | 13 ++----------- 1 files changed, 2 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mina/blob/5f337262/core/src/main/java/org/apache/mina/transport/nio/tcp/NioTcpClient.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/mina/transport/nio/tcp/NioTcpClient.java b/core/src/main/java/org/apache/mina/transport/nio/tcp/NioTcpClient.java index 9b18acb..5178d05 100644 --- a/core/src/main/java/org/apache/mina/transport/nio/tcp/NioTcpClient.java +++ b/core/src/main/java/org/apache/mina/transport/nio/tcp/NioTcpClient.java @@ -52,9 +52,6 @@ public class NioTcpClient extends AbstractTcpClient { /** A logger for this class */ private static final Logger LOG = LoggerFactory.getLogger(NioTcpClient.class); - /** the bound address */ - private SocketAddress address = null; - /** the SelectorLoop for connecting the sessions */ // This is final, so that we know if it's not initialized private final SelectorLoop connectSelectorLoop; @@ -115,7 +112,6 @@ public class NioTcpClient extends AbstractTcpClient { public IoFuture<IoSession> connect(SocketAddress remoteAddress) throws IOException { Assert.assertNotNull(remoteAddress, "remoteAddress"); - address = remoteAddress; SocketChannel clientSocket = SocketChannel.open(); clientSocket.socket().setSoTimeout(getConnectTimeoutMillis()); @@ -187,7 +183,7 @@ public class NioTcpClient extends AbstractTcpClient { session.initSecure(config.getSslContext()); } - // connect to a running server. We get an immediate result if + // connect to a running server. We get an immediate result if // the socket is blocking, and either true or false if it's non blocking boolean connected = clientSocket.connect(remoteAddress); @@ -225,18 +221,13 @@ public class NioTcpClient extends AbstractTcpClient { * {@inheritDoc} */ public synchronized void disconnect() throws IOException { - LOG.info("Disconnecting {}", address); - - if (this.address == null) { - throw new IllegalStateException("server not bound"); - } + LOG.info("Disconnecting sessions"); // Close all the existing sessions for (IoSession session : getManagedSessions().values()) { session.close(true); } - address = null; fireServiceInactivated(); // will stop the idle processor if we are the last service
