This project is read-only.

Reason for disconnect, when using RasConnectionWatcher?

Oct 26, 2010 at 3:19 PM
Edited Oct 26, 2010 at 3:19 PM


I'm not sure if this is documented anywhere- could find anything related... Is there a way to retrieve a REASON WHY connection was broken from within Disconnected callback of RasConnectionWatcher? The callback declaration is as follows:


Disconnected(object sender, DotRas.RasConnectionEventArgs e)


What can I use to retrieve a reason for disconnect.


Thanks a lot,


Oct 26, 2010 at 9:22 PM

Unfortunately that information is not available.

The RasConnectionNotification API ( which the RasConnectionWatcher uses, uses simple events to notify when the states change. The RasConnectionWatcher just stores the list when it first loaded and compares it to the list of connections retrieved after to determine what changed. It would be nice if that information was available, but unfortunately it's just a limitation of the RAS APIs.