Catching exceptions....Client crashes....
I have written a Server and Client program for my Final Year Project, its a 2D Chat room with 4 different chat room environments.
It pretty cool and Ill be releasing it as freeware soon enough once I learn how maybe to prevent people from saying its their own, if you know what I mean.
Ok heres the problem. I was testing it yesterday and I had 8 users logged in from one machine. I tried to simulate 8 client programs crashing in one go; I did this by resetting the PC.
Now I though the server would of realised immediately. Each client that is connected to the server has one thread allocated to it, which sits and listens for incoming messages and when a message comes in it deals with it and passes it on to the other clients. Now I thought that when the client crashes there is an exception thrown where the thread is listening for user messages. And I have it that when it happens it cleans up and updates all the other connected users e.g. removes the user from the room, update the amount of users count in the room in all the other users GUIs.
Now when I did this test yesterday I took a while for the server to realise. Now dont be mistaken; there was no deadlock or anything else like that. Cause the program didnt freeze up. All the users were removed from the server within 1 minute of it happening.
I am using TCP sockets by the way.
But I am wondering why it didnt happen immediately?
Any suggestion ?
Thanks,
Tommy

