This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.