From 600325d1e3e76c2e6341a9ee4e5dc29c76d14f4a Mon Sep 17 00:00:00 2001 From: leventov Date: Fri, 4 Sep 2015 16:53:49 +0300 Subject: [PATCH] HCOLL-383 Fix TcpReplicator --- .../java/net/openhft/chronicle/map/TcpReplicator.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java index cdcfaef38..69ab96e1e 100644 --- a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java +++ b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java @@ -430,7 +430,7 @@ final class TcpReplicator extends AbstractChannelReplicator implements Clo // is no-longer required as the remote node will establish the connection its self // on startup. - attached.connector.connect(); + attached.connector.connectLater(); throw e; } @@ -977,11 +977,7 @@ final class TcpReplicator extends AbstractChannelReplicator implements Clo socketChannel.socket().setSoLinger(false, 0); socketChannel.socket().setSoTimeout(0); - try { - socketChannel.connect(details.address()); - } catch (UnresolvedAddressException e) { - this.connectLater(); - } + socketChannel.connect(details.address()); // Under experiment, the concoction was found to be more successful if we // paused before registering the OP_CONNECT @@ -1018,6 +1014,7 @@ final class TcpReplicator extends AbstractChannelReplicator implements Clo } catch (IOException e) { LOG.error("", e); } + this.connectLater(); } } }