IPEndPoint Constructor (IPAddress, Int32)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Initializes a new instance of the IPEndPoint class with the specified address and port number.

Namespace:  System.Net
Assembly:  System.Net (in System.Net.dll)

Syntax

'Declaration
Public Sub New ( _
    address As IPAddress, _
    port As Integer _
)
public IPEndPoint(
    IPAddress address,
    int port
)

Parameters

  • port
    Type: System.Int32
    The port number associated with the address, or 0 to specify any available port. port is in host order.

Exceptions

Exception Condition
ArgumentNullException

The address parameter is nulla null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

port is less than MinPort.

-or-

port is greater than MaxPort.

Remarks

The IPEndPoint(IPAddress, Int32) constructor can be used to initialize an IPv4 or IPv6 address.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.