Skip to content

Commit

Permalink
Printing addres:port of client when wrong cookie is encountered
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Jun 20, 2016
1 parent 88d6a21 commit 6664a14
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/org/jgroups/blocks/cs/TcpConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,9 @@ protected Address readPeerAddress(Socket client_sock) throws Exception {
byte[] input_cookie=new byte[cookie.length];
in.readFully(input_cookie, 0, input_cookie.length);
if(!Arrays.equals(cookie, input_cookie))
throw new SocketException("BaseServer.TcpConnection.readPeerAddress(): cookie read by "
+ server.localAddress() + " does not match own cookie; terminating connection");
throw new SocketException(String.format("%s: BaseServer.TcpConnection.readPeerAddress(): cookie sent by " +
"%s:%d does not match own cookie; terminating connection",
server.localAddress(), client_sock.getInetAddress(), client_sock.getPort()));
// then read the version
short version=in.readShort();
if(!Version.isBinaryCompatible(version))
Expand Down

0 comments on commit 6664a14

Please sign in to comment.