PeerNameRegistration::Port Property

 

Gets or sets the TCP/IP port number used by the peer being registered into the PeerNameRegistration object.

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

public:
property int Port {
	int get();
	void set(int value);
}

Property Value

Type: System::Int32

An integer value indicating the TCP port number of the IPEndPoint. Unless explicitly specified, the default value for this property is zero (0).

Exception Condition
ArgumentOutOfRangeException

The specified port value is less than zero. Port numbers must be greater than or equal to zero and less than 65,535 (0xFFFF).

The default port is used by the Start method only when no endpoints are specified.

.NET Framework
Available since 3.5
Return to top
Show: