I have a 2D shooter applet and i can’t figure out away to tell when a player has disconnected ???
At the moment i have the server readline of incomming data and i use a catch(IOException) and if that throws up i disconnect the client this works fine in eclipse, however when i put it up on the web when people clossed the tab the game is on for example the server won’t realised they have disconnected and the catch wont be thrown up for about another 30-120 secounds which is way to long!
I thought about making a timer but if i did how would i stop the thread thats trying to read a line of incomming data thus disconnecting the player?