AssociateToNetworkInterface Method
Collapse the table of content
Expand the table of content

SocketExtensions.AssociateToNetworkInterface Method

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

Sets information about a network interface by associating it with a new set of network interface information.

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

'Declaration
<ExtensionAttribute> _
Public Shared Sub AssociateToNetworkInterface ( _
	socket As Socket, _
	networkInterface As NetworkInterfaceInfo _
)

Parameters

socket
Type: System.Net.Sockets.Socket
The network interface for which to set information.
networkInterface
Type: Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceInfo
The new network interface information.

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 or networkInterface is Nothing.

ArgumentException

networkInterface is not connected.

NetworkException

socket is already bound.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Show:
© 2016 Microsoft