Code example for InetSocketAddress

Methods: equals

0
      if (this == o) return true;
      if (o == null || getClass() != o.getClass()) return false;
 
      TcpTransport that = (TcpTransport) o;
 
      if (serverAddress != null ? !serverAddress.equals(that.serverAddress) : that.serverAddress != null) return false;
      if (socket != null ? !socket.equals(that.socket) : that.socket != null) return false;
 
      return true; 
   } 
 
   @Override 
   public int hashCode() { 
      int result = socket != null ? socket.hashCode() : 0;
      result = 31 * result + (serverAddress != null ? serverAddress.hashCode() : 0);
      return result;
   } 
 
   public void destroy() { 
      try { 
         socket.close();