แก้ไข

แชร์ผ่าน


PeerNameRegistration Constructors

Definition

Initializes a new instance of the PeerNameRegistration class.

Overloads

PeerNameRegistration()

Initializes a new default instance of the PeerNameRegistration class.

PeerNameRegistration(PeerName, Int32)

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

PeerNameRegistration(SerializationInfo, StreamingContext)

Initializes a new serializable PeerNameRegistration object.

PeerNameRegistration(PeerName, Int32, Cloud)

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

PeerNameRegistration()

Initializes a new default instance of the PeerNameRegistration class.

public:
 PeerNameRegistration();
public PeerNameRegistration ();
Public Sub New ()

Remarks

Returns a new default instance of type PeerNameRegistration. It does not perform peer name registration during construction.

After instantiating an object with this constructor, the caller should populate the appropriate fields in the instance prior to calling Start or Stop.

Applies to

PeerNameRegistration(PeerName, Int32)

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

public:
 PeerNameRegistration(System::Net::PeerToPeer::PeerName ^ name, int port);
public PeerNameRegistration (System.Net.PeerToPeer.PeerName name, int port);
new System.Net.PeerToPeer.PeerNameRegistration : System.Net.PeerToPeer.PeerName * int -> System.Net.PeerToPeer.PeerNameRegistration
Public Sub New (name As PeerName, port As Integer)

Parameters

name
PeerName

The PeerName object to register.

port
Int32

Integer value that specifies the port number to register.

Exceptions

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.

Remarks

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.

Applies to

PeerNameRegistration(SerializationInfo, StreamingContext)

Initializes a new serializable PeerNameRegistration object.

protected:
 PeerNameRegistration(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected PeerNameRegistration (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Net.PeerToPeer.PeerNameRegistration : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.PeerToPeer.PeerNameRegistration
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parameters

info
SerializationInfo

Reference to the object that holds the data needed to deserialize this instance.

context
StreamingContext

Context that provides the means for deserializing the data. Also referred to as the source of the serialized data.

See also

Applies to

PeerNameRegistration(PeerName, Int32, Cloud)

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

public:
 PeerNameRegistration(System::Net::PeerToPeer::PeerName ^ name, int port, System::Net::PeerToPeer::Cloud ^ cloud);
public PeerNameRegistration (System.Net.PeerToPeer.PeerName name, int port, System.Net.PeerToPeer.Cloud cloud);
new System.Net.PeerToPeer.PeerNameRegistration : System.Net.PeerToPeer.PeerName * int * System.Net.PeerToPeer.Cloud -> System.Net.PeerToPeer.PeerNameRegistration
Public Sub New (name As PeerName, port As Integer, cloud As Cloud)

Parameters

name
PeerName

The PeerName object to register.

port
Int32

Integer value that specifies the port number to register.

cloud
Cloud

Cloud in which to register the peer name.

Exceptions

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.

Remarks

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.

Applies to