#25 Uncatchable exception when network is unplugged (XP only)

open
milans
None
5
2010-09-20
2010-09-14
No

This error happens under Windows XP, but not under Windows7.
When network is unplugged and I try to asynchronously send SNMP request, an unhandled exception is thrown inside the library and there is no way to catch it. Whole application crashes.

Steps to reproduce:
1. compile attached code
2. Physically Plug out network cable so that you see message "network cable is unplugged"
3. Run program

Result: What you see is application crash message with option to send a report to Microsoft.
Expected: either "Exception catched" mesage or "ProcessResponse function executed! Result is: ..." message.

What I managed to discover is that exception is NullReferenceException thrown in UdpTransport.cs, at line 301 (ReceiveBegin() function).

Discussion

  • Michał Narwojsz

    Sample code to reproduce an error

     
  • milans

    milans - 2010-09-20

    I have managed to reproduce the problem using WinXP in VMware and did find a problem with the flow of method calls in the async request processing that resulted in receive method call when send method failed.

    Fixing this just seams to have moved where the exception happens.

    At this time it looks like Socket becomes unusable when network cable is disconnected and needs to be recreated but that is not a definitive answer so I'm going to keep looking to see if I can nail it down to a specific call.

     
  • milans

    milans - 2010-09-20
    • assigned_to: nobody --> msinadinovic
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks