Win32 error

May 28, 2012 at 7:41 PM
Edited May 28, 2012 at 7:42 PM

Hi everybody.

I have been using this API successfully and without any major problems. Until today at least... 

I have implemented a program in C# which among others retrieves the BSSID of the connected A.P. and the number of the available wireless networks in proximity and does a number of checks. When I am connected to a certain A.P. I get a message and when I am not connected to this specific A.P. (but to another one or I am not connected at all) I get another message. Simple as that.

I did this, connection to the A.P,  check once and only - when the application starts.

But...I wanted to add a timer so that this check happens every 60 seconds (and not only at the beginning). The problem is that it runs once (or sometimes it doesn't even run once) and then the program freezes and I get the following message:

Win32Exception was unhandled:

An attempt was made to establish a session to a network server, but there are already too many sessions established to that server

and the message box points to WlanClient client = new WlanClient();

I don't know what is incorrect and although the code compiles correctly I get this error. 

Maybe is something with the dispose of the objects?

Any help will be much appreciated. 

Jun 5, 2012 at 2:05 AM
Edited Jun 5, 2012 at 11:41 AM

I think I managed to figured it out.

Thank you anyway!