I have a WCF application that sometimes performs long running queries. I have created code on the client side that understands when a Timeout on the socket has occurred and will take steps to repoll the server later to grab the answer. The system throws a number of first-chance exceptions just before the TimeoutException occurs including SocketException. In the past, first-chance exceptions have slowed my apps considerably until I caught and handled them.
I want to get rid of these first-chance exceptions so I created a try-catch block to handle the SocketException and turned on the exceptions in VS2010 and reran the code. When I did, I saw the debugger show me that the SocketException had occurred, but my catch block was never entered. (see below)
I found a number of similar posts including C# SocketException doesn't get caught but none of the answers I found address how to catch the Exception, or whether I should even worry about it.
So my questions are:
1) Should I be worrying about these first chance exceptions?
2) If so, how do I get the system to catch them?