Reason for disconnect, when using RasConnectionWatcher?

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

Hi:

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,

Michael

Coordinator
Oct 26, 2010 at 9:22 PM

Unfortunately that information is not available.

The RasConnectionNotification API (http://msdn.microsoft.com/en-us/library/aa376726(VS.85).aspx) 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.