From 5b2950e420c00c99344fc962f521690630eadc84 Mon Sep 17 00:00:00 2001 From: Rob Austin Date: Mon, 23 Feb 2015 09:58:28 +0000 Subject: [PATCH] HCOLL-309 added a return and now outputting the remote connection. --- .../net/openhft/chronicle/map/TcpReplicator.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java index 6c0e060b8..b04ad4e25 100644 --- a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java +++ b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java @@ -32,7 +32,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.Closeable; -import java.io.EOFException; import java.io.IOException; import java.net.*; import java.nio.BufferUnderflowException; @@ -648,15 +647,23 @@ final class TcpReplicator extends AbstractChannelReplicator implements Clo attached.serverVersion = reader.readRemoteServerVersion(); } catch (IllegalStateException e1) { socketChannel.close(); + return; } if (attached.serverVersion == null) return; if (!isValidVersionNumber(attached.serverVersion)) { - LOG.warn("Please check that you don't have a third party system incorrectly connecting to ChronicleMap, " + - "Closing the remote connection as Chronicle can not make sense of the remote version number received from the external connection, version="+attached.serverVersion+", Chronicle is expecting the version number to only contain '.',A-Z,a-z,0-9"); + LOG.warn("Closing the remote connection : Please check that you don't have a third " + + "party system incorrectly " + + "connecting to ChronicleMap, remoteAddress=" + socketChannel.getRemoteAddress() + + ", so closing the remote connection as Chronicle can not make sense of the " + + "remote version number received from the external connection, " + + "version=" + attached.serverVersion + ", " + + "Chronicle is expecting the version number to only contain " + + "'.','-', ,A-Z,a-z,0-9"); socketChannel.close(); + return; } checkVersions(attached);