zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lvfangmin <...@git.apache.org>
Subject [GitHub] zookeeper pull request #544: ZOOKEEPER-3009 : fix the related bugs in branch...
Date Sat, 21 Jul 2018 18:23:11 GMT
Github user lvfangmin commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/544#discussion_r204217429
  
    --- Diff: src/java/main/org/apache/zookeeper/server/NIOServerCnxnFactory.java ---
    @@ -129,11 +129,14 @@ public int getLocalPort(){
             return ss.socket().getLocalPort();
         }
     
    -    private void addCnxn(NIOServerCnxn cnxn) {
    +    private void addCnxn(NIOServerCnxn cnxn) throws IOException {
             synchronized (cnxns) {
                 cnxns.add(cnxn);
                 synchronized (ipMap){
    -                InetAddress addr = cnxn.sock.socket().getInetAddress();
    +                InetAddress addr = cnxn.getSocketAddress();
    +                if (addr == null) {
    +                	throw new IOException("Socket of " + cnxn + " has been closed");
    --- End diff --
    
    nit: keep indent.


---

Mime
View raw message