Android.Net.ConnectivityManager.SetProcessDefaultNetwork Method
Binds the current process to network.

Syntax

[Android.Runtime.Register("setProcessDefaultNetwork", "(Landroid/net/Network;)Z", "")]
public static bool SetProcessDefaultNetwork (Network network)

Parameters

network
The Android.Net.Network to bind the current process to, or null to clear the current binding.

Returns

Documentation for this section has not yet been entered.

Remarks

Binds the current process to network. All Sockets created in the future (and not explicitly bound via a bound SocketFactory from Network.SocketFactory) will be bound to network. All host name resolutions will be limited to network as well. Note that if network ever disconnects, all Sockets created in this way will cease to work and all host name resolutions will fail. This is by design so an application doesn't accidentally use Sockets it thinks are still bound to a particular Android.Net.Network. To clear binding pass null for network. Using individually bound Sockets created by Network.getSocketFactory().createSocket() and performing network-specific host name resolutions via Network.GetAllByName(string) is preferred to calling setProcessDefaultNetwork.

[Android Documentation]

Requirements

Namespace: Android.Net
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1