SetNetworkRequirement Method
Collapse the table of content
Expand the table of content

SocketExtensions.SetNetworkRequirement Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Sets the requirement for a network interface to use either cellular or non-cellular technology.

Namespace:  Microsoft.Phone.Net.NetworkInformation
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)

'Declaration
<ExtensionAttribute> _
Public Shared Sub SetNetworkRequirement ( _
	socket As Socket, _
	requirement As NetworkSelectionCharacteristics _
)

Parameters

socket
Type: System.Net.Sockets.Socket
The network interface for which to set the requirement.
requirement
Type: Microsoft.Phone.Net.NetworkInformation.NetworkSelectionCharacteristics
One of the enumeration values that specify the required type of technology.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Socket. When you use instance method syntax to call this method, omit the first parameter.

ExceptionCondition
ArgumentNullException

socket is Nothing.

NetworkException

socket is already bound.

NetworkException

Unable to get the session handle for socket.

NetworkException

Unable to set the network requirement.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Show:
© 2017 Microsoft