PeerNameRegistration Constructor (PeerName, Int32, Cloud)

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)

new : 
        name:PeerName *
        port:int *
        cloud:Cloud -> PeerNameRegistration


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.

Exception Condition

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
Available since 3.5
Return to top
© 2015 Microsoft