Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Server Disconnect Detection  RSS feed

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


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
Boost this thread!