Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Server Disconnect Detection

 
johnny parker
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello,

I've completed building my java chess server using blocking tcp sockets, everything works like a charm, but i am having troubles detecting disconnections and i have to do that for removing clients from connected clients list so users can log in again after..Chess client is an IOS application so app can go in background and i wont be able to send alive messages to server setting up a timer because timers doesnt work in background normally, meaning i cant set socket timeout on server because now i can receive moves and game can continue even after 5 minutes of background mode. So how can i detect a disconnection, without setting socket timeout, like when wifi goes off ? It doesn't throw any kind of exception even if i am sending heartbeats and writing to the socket every 30 seconds to clients, any ideas would be appreciated thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic