recovering from exceptions C#
Hello ... I'm writing a Client/Server socket program in which all clients get passed a date/time string for a fixed amount of time. I have the write() function in a try {} block and following that is the exception block (SocketException). The problem I'm having is when the client closes its connection before the loop can terminate it causes the program to throw exceptions - which it should.
What I'm looking for: I'm looking for a way to handle a recovery from the current exception in this case I know its a SocketException because of the write() function. (i.e. in this case reconnect or give an error message, then close down all TCP connections and quit ). I was looking into delegates and events to handle this but now I'm going alittle crazy!! :confused: :confused:
If anyone has any examples of recovering from an exception that has occured or another error routine it would help a bunch!!
Thanks - Fred