Github user arshadmohammad commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/338#discussion_r136166969 --- Diff: src/java/main/org/apache/zookeeper/server/FinalRequestProcessor.java --- @@ -476,6 +624,33 @@ private boolean connClosedByClient(Request request) { return request.cnxn == null; } + private String getHostAddress(ServerCnxn cnxn) { + try { + if (cnxn == null) { + return ""; + } + InetSocketAddress remoteSocketAddress = cnxn + .getRemoteSocketAddress(); + if (remoteSocketAddress == null) { + return ""; + } + InetAddress address = remoteSocketAddress.getAddress(); + if (address == null) { + return ""; + } + return address.getHostAddress(); + } catch (Exception e) { + // ignore + } + return ""; + } + + private String getSessionId(ServerCnxn cnxn) { --- End diff -- moved to ServerCnxn
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---