-
Notifications
You must be signed in to change notification settings - Fork 23
QuantumGate::Local::DisconnectFrom
Karel Donk edited this page Dec 10, 2019
·
8 revisions
Initiates disconnection from a peer on the network and either returns immediately (2 and 4) or blocks until the peer is disconnected or the attempt failed (1 and 3). The optional DisconnectCallback
function gets called when the peer was disconnected (2 and 4).
-
Result<> DisconnectFrom(const PeerLUID pluid) noexcept;
-
Result<> DisconnectFrom(const PeerLUID pluid, DisconnectCallback&& function) noexcept;
-
Result<> DisconnectFrom(Peer& peer) noexcept;
-
Result<> DisconnectFrom(Peer& peer, DisconnectCallback&& function) noexcept;
Name | Description |
---|---|
pluid |
A QuantumGate::PeerLUID with the Locally Unique Identifier of the connected peer. |
peer |
A QuantumGate::Peer representing the connected peer. |
function |
A QuantumGate::DisconnectCallback object containing the function to call when the connection closes. See QuantumGate Callbacks for more details. This parameter can be nullptr . |
Returns a QuantumGate::Result
object equal to one of the following QuantumGate::ResultCode
s:
Value | Description |
---|---|
QuantumGate::ResultCode::Succeeded |
The operation succeeded. |
QuantumGate::ResultCode::Failed |
The operation failed. |
QuantumGate::ResultCode::PeerNotFound |
The operation failed because the peer wasn't found. |
QuantumGate::ResultCode::NotRunning |
The operation failed because the instance isn't running. |