The first SocketException that throws but my catch does not work

I have a WCF application that sometimes performs lengthy requests. I created a client-side code that understands when a timeout occurred on the socket, and it will take steps to retry the server later to get a response. The system generates a series of exceptions with the first chance before a TimeoutException event occurs, including a SocketException. Previously, exceptions from the first chance slowed down my applications significantly until I caught and processed them.

I want to get rid of these exceptions with a first chance, so I created a try-catch block to handle SocketException and included exceptions in VS2010 and re-run the code. When I did this, I saw that the debugger showed me that a SocketException had occurred, but my catch block was not injected. (see below)

enter image description here

I found several similar messages, including C # SocketException didn’t get there , but none of the answers I found found how to catch the Exception, or I should even worry about that.

So my questions are:

1) Should I worry about these first random exceptions?

2) If so, how do I get the system to catch them?

+3
source share
2 answers

, AppDomain.FirstChanceException Event

:

  AppDomain.CurrentDomain.FirstChanceException += FirstChanceHandler;

, , . http://msdn.microsoft.com/en-us/library/system.appdomain.firstchanceexception.aspx

+2

, .

, .

( ).

+2

All Articles