Namespace:
Rebex.Net.ConnectionManagement
Assembly:
Rebex.Networking (in Rebex.Networking.dll)
Syntax
Visual Basic |
---|
Public Shared Function IsConnected As Boolean |
C# |
---|
public static bool IsConnected() |
Return Value
true if the device is connected to the Internet, otherwise returns false.Remarks
This method IS NOT suitable for checking the general availability of the Internet connection on the device!
Method returns true only if the all of the following conditions are met.
1. An Internet connection has been established directly or indirectly using one of the TryConnect()()()() method overloads.
2. Device connection manager reports that the connection is still active.
Be aware that the returned value is a subject to the inherent and unavoidable race condition. When this method returns true, there is not any guarantee that the connection was not closed between the time of the last call of the method and the time when you are checking the returned value. Similarly, when this method returns false, there is not any guarantee that the connection was not opened between the time of the last call of the method and the time when you are checking the returned value.