Skip to content

QuantumGate::Local::DisconnectFrom

Karel Donk edited this page Jul 9, 2018 · 8 revisions

Initiates disconnection from a peer on the network and returns immediately. The optional DisconnectCallback function gets called when the peer was disconnected.

Signature

Result<> DisconnectFrom(PeerLUID pluid,
                        DisconnectCallback&& function) noexcept;

Parameters

Name Description
pluid A QuantumGate::PeerLUID with the Locally Unique Identifier of 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.

Return values

Returns a QuantumGate::Result object equal to one of the following QuantumGate::ResultCodes:

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.
Clone this wiki locally