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)

Syntax

<ExtensionAttribute> _
Public Shared Sub AssociateToNetworkInterface ( _
    socket As Socket, _
    networkInterface As NetworkInterfaceInfo _
)
public static void AssociateToNetworkInterface(
    this Socket socket,
    NetworkInterfaceInfo networkInterface
)

Parameters

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.

Exceptions

Exception Condition
ArgumentNullException

socket or networkInterface is nullNothingnullptra null reference (Nothing in Visual Basic).

ArgumentException

networkInterface is not connected.

NetworkException

socket is already bound.

Remarks

For more information about extension methods, see Extension Methods (C# Programming Guide) or How to: Call an Extension Method (Visual Basic).

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Platforms

Windows Phone

See Also

Reference

SocketExtensions Class

Microsoft.Phone.Net.NetworkInformation Namespace