0

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());
}
AnimatedRNG
  • 1,859
  • 3
  • 26
  • 39

1 Answers1

0

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

user207421
  • 305,947
  • 44
  • 307
  • 483
  • 1
    @Fox32 A post that starts with the word 'because' cannot logically be said to not provide an answer. And I am certainly not requesting clarification or critiquing the question. Your comment makes no sense. – user207421 Jun 22 '14 at 21:44
  • Is there any way to figure out which client disconnected? If there is no way to figure out who disconnected, that callback is basically useless. I need to be able to stop the processes the client invoked on the server after he/she logs out. – AnimatedRNG Jun 22 '14 at 23:30
  • You would need to keep a map of `Connection` to client. – user207421 Jun 23 '14 at 01:08