code: public HostAndPort getRemoteAddress(Object client)
      {
          NiftyClientChannel niftyChannel = getNiftyChannel(client);
  
          try {
              Channel nettyChannel = niftyChannel.getNettyChannel();
              SocketAddress address = nettyChannel.getRemoteAddress();
              InetSocketAddress inetAddress = (InetSocketAddress) address;
              return HostAndPort.fromParts(inetAddress.getHostString(), inetAddress.getPort());
          }
          catch (NullPointerException | ClassCastException e) {
              throw new IllegalArgumentException("Invalid swift client object", e);
          }
      }
docs: Returns the remote address that a Swift client is connected to
  
  @throws IllegalArgumentException if the client is not a Swift client or is not connected
  through an internet socket