Export (0) Print
Expand All

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
)

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.

cloud
Type: System.Net.PeerToPeer.Cloud

Cloud in which to register the peer name.

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 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.6, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft