This documentation is archived and is not being maintained.

PeerNameRegistration Constructor (PeerName, Int32, Cloud)

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

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

public PeerNameRegistration(
	PeerName name,
	int port,
	Cloud cloud


Type: System.Net.PeerToPeer.PeerName
The PeerName object to register.
Type: System.Int32
Integer value that specifies the port number to register.
Type: System.Net.PeerToPeer.Cloud
Cloud in which to register the peer name.


The name parameter cannot be null.


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

  • 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 IPv6 and IPv4), the provided port, and the specified Cloud. If the object is constructed successfully, the properties are populated with the specified PeerName, Port and Cloud.

If the cloud parameter is null, the name is registered using the Available shortcut, which initializes default values for the Name, Scope, and ScopeId.

After instantiation, the Start method must be called to register the PeerName.

.NET Framework

Supported in: 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.