PeerNameRegistration Constructor (PeerName^, Int32)
Initializes a new instance of the PeerNameRegistration class with the specified name and port number.
Assembly: System.Net (in System.Net.dll)
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.
| Exception | Condition |
|---|---|
| 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 |
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.
Available since 3.5