-1

Possible Duplicate:
Java: Detecting client disconnects from server side

What is the best way to check if a client is still connected to the server? Tell me exactly how the method you're suggesting works.

Community
  • 1
  • 1
Qualphey
  • 1,224
  • 1
  • 18
  • 44

2 Answers2

1

Get the client to send a heartbeat message. When no message has been received for a given length, the client can be disconnected.

Peter Lawrey
  • 513,304
  • 74
  • 731
  • 1,106
-1

what type of class for your client?If you use socket, there is a function isConnected() you can try!

BenMorel
  • 31,815
  • 47
  • 169
  • 296
liqiang
  • 1
  • 1