Skip to content

QuantumGate::Local::DisconnectFrom

Karel Donk edited this page Jun 10, 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

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 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