-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,244
  • 1
  • 19
  • 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
  • 525,659
  • 79
  • 751
  • 1,130
-1

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

BenMorel
  • 34,448
  • 50
  • 182
  • 322
liqiang
  • 1
  • 1