Search code examples
socketstcpkryonet

Kryonet disconnect() connection cannot get TCP address


In my disconnect() method in the Listener, the InetSocketAddress object is always null. Why does this happen?

@Override
public void disconnected(Connection connection) {
    Log.info("Server disconnected from " + connection.getRemoteAddressTCP());
}

Solution

  • Because it's already disconnected. So there is no remote address.