This project is read-only.

Dialer blocked in a state

Jun 27, 2011 at 4:13 PM

Hello Jeff


I would like to know how to detect that an instance of RasDialer stays blocked in a state (like device not reachable, wrong credentials...). I can see in Network Connections that the connection I use disconnects, but I can't catch the event using a RasWatcher.

What would be possible to do ?


Thank you


Jun 27, 2011 at 11:45 PM
Edited Jun 27, 2011 at 11:47 PM

If you're dialing synchronously (using RasDialer.Dial) the exception would be thrown so you can catch it and handle the problem, if you're dialing asynchronously (using RasDialer.DialAsync) you'll need to handle the Error event on RasDialer to catch any errors that occur on the background thread that's doing the dialing.

Edit: Actually Error only occurs when an exception is thrown while trying to process something on the background thread. The DialCompleted event would have an error in e.Error if there was a problem while connecting.