ConnectivityManager.RequestRouteToHost(ConnectivityType, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Caution
deprecated
Ensure that a network route exists to deliver traffic to the specified host via the specified network interface.
[Android.Runtime.Register("requestRouteToHost", "(II)Z", "GetRequestRouteToHost_IIHandler")]
[System.Obsolete("deprecated")]
public virtual bool RequestRouteToHost (Android.Net.ConnectivityType networkType, int hostAddress);
[<Android.Runtime.Register("requestRouteToHost", "(II)Z", "GetRequestRouteToHost_IIHandler")>]
[<System.Obsolete("deprecated")>]
abstract member RequestRouteToHost : Android.Net.ConnectivityType * int -> bool
override this.RequestRouteToHost : Android.Net.ConnectivityType * int -> bool
Parameters
- networkType
- ConnectivityType
the type of the network over which traffic to the specified host is to be routed
- hostAddress
- Int32
the IP address of the host to which the route is desired
Returns
true
on success, false
on failure
- Attributes
Remarks
Ensure that a network route exists to deliver traffic to the specified host via the specified network interface. An attempt to add a route that already exists is ignored, but treated as successful.
This method requires the caller to hold either the android.Manifest.permission#CHANGE_NETWORK_STATE
permission or the ability to modify system settings as determined by android.provider.Settings.System#canWrite
.
This member is deprecated. Deprecated in favor of the #requestNetwork(NetworkRequest, NetworkCallback)
, #bindProcessToNetwork
and Network#getSocketFactory
API. In VERSION_CODES#M
, and above, this method is unsupported and will throw UnsupportedOperationException
if called.
Java documentation for android.net.ConnectivityManager.requestRouteToHost(int, int)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.