Skip to content

QuantumGate::Local::DisconnectFrom

Karel Donk edited this page Jun 3, 2018 · 8 revisions

Initiates disconnection from a peer on the network. The optional DisconnectCallback function gets called upon completion. If a DisconnectCallback was supplied when the connection was made through the QuantumGate::Local::ConnectTo function, that one gets replaced.

Signature

const Result DisconnectFrom(const PeerLUID pluid, DisconnectCallback&& function = nullptr) noexcept;

Parameters

Name Description
pluid A QuantumGate::PeerLUID with the Locally Unique Identifier of the connected peer.
disconnect_func A QuantumGate::DisconnectCallback object containing the function to call when the connection closes. Defaults to nullptr. See QuantumGate Callbacks for more details.

Return values

Returns a QuantumGate::Result object containing 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::FailedNotRunning The operation failed because the instance isn't running.
Clone this wiki locally