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.
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.| Exception | Condition |
|---|---|
| ArgumentNullException | socket or networkInterface is Nothing. |
| ArgumentException | networkInterface is not connected. |
| NetworkException | socket is already bound. |
For more information about extension methods, see Extension Methods (C# Programming Guide) or How to: Call an Extension Method (Visual Basic).
Show: