Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

PeerNameRegistration Constructor (PeerName, Int32)

Initializes a new instance of the PeerNameRegistration class with the specified name and port number.

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

public PeerNameRegistration(
	PeerName name,
	int port
)

Parameters

name
Type: System.Net.PeerToPeer.PeerName

The PeerName object to register.

port
Type: System.Int32

Integer value that specifies the port number to register.

ExceptionCondition
ArgumentNullException

The name parameter cannot be null.

ArgumentOutOfRangeException

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

PeerToPeerException
  • The PeerName specified has already been registered from this host.

  • The remote peer does not own the Authority for the supplied PeerName object.

Calling this constructor creates an instance that will be used to register all source addresses (both IPv6and IPv4) and the provided port for all clouds in which the peer is currently participating. If the object is constructed successfully, the specified PeerName and Port are populated.

If the peer name is secured and was previously registered in a Cloud the peer is currently participating in, an PeerToPeerException is thrown.

This constructor only creates a PeerNameRegistration instance; it does not perform the registration. After instantiating the registration object with this constructor and populating its fields, the application must call Start to perform the actual registration.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft