I have developed an application that sends messages over a GPRS modem (connected via SerialPort and using your PPP class) using sockets.
In the documentation it is written, that you should subscribe to the following event:
NetworkChange.NetworkAvailabilityChanged += new NetworkAvailabilityChangedEventHandler(NetworkChange_NetworkAvailabilityChanged);
to be informed when the network becomes unavailable - at leas as far as I understood.
When I connect using PPP the first time, that event is fired and tells me that the network is now available.
However when I wrap my modem in alu foil and screw off the antenna that event is not raised, even though I know exactly that it has no connection whatsoever.
(AT+CSQ returns a value between 2,9 and 4, which is not sufficient to attach to the GPRS network and connect via PPP)
The only thing that happens is that the “Socket.Send(byte data)” method stucks forever.
Am I doing something wrong - do I miss something, or is the NetworkAvailabilityChanged event just not thought of for this purpose and if so, how can I detect that the network is unavailable and react to that?
Thank you very much!