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.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008

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

.NET Framework

Supported in: 3.5

Community Additions

ADD
Show:
© 2014 Microsoft