Skip to content

QuantumGate::ConnectParameters

Karel Donk edited this page Jan 12, 2022 · 12 revisions

QuantumGate::ConnectParameters is a struct that contains settings for connecting to another peer on the network.

Definition

struct ConnectParameters
{
    Endpoint PeerEndpoint;
    std::optional<ProtectedBuffer> GlobalSharedSecret;
    bool ReuseExistingConnection{ true };

    struct
    {
        bool RequireAuthentication{ true };
    } Bluetooth;

    struct
    {
        UInt8 Hops{ 0 };
        std::optional<PeerLUID> GatewayPeer;
    } Relay;
};

Member variables

Name Description
PeerEndpoint A QuantumGate::Endpoint object containing the endpoint to connect to. See QuantumGate::Endpoint for more details.
GlobalSharedSecret An optional QuantumGate::ProtectedBuffer object containing the global shared secret that the peer is configured with. If a default global shared secret was specified in the QuantumGate::StartupParameters for the local instance, it gets overridden for this connection. If this member variable is not specified (i.e. the std::optional is empty), and a default global shared secret was specified in the QuantumGate::StartupParameters then that one gets used. If an empty buffer is specified (i.e. the std::optional contains an empty QuantumGate::ProtectedBuffer) then no global shared secret will be used.
ReuseExistingConnection A bool value indicating whether QuantumGate is allowed to reuse an existing connection to the peer (true) or not (false). To force QuantumGate to create a new connection to the peer specify false. The default value is true. To check whether an existing connection to the peer exists that can be reused, QuantumGate looks for connections on the local instance with the same IP address and port specified in the PeerIPEndpoint member and the number of hops specified in the Relay::Hops member.
Bluetooth::RequireAuthentication A bool value indicating whether QuantumGate should require Bluetooth authentication (true) or not (false) when connecting to a peer. When authentication is required, the operating system will prompt the user to first pair the local and remote devices via Bluetooth. If pairing/authentication fails the connection will not get established. The default value is true.
Relay::Hops The number of hops to establish a relayed connection. A value of 0, which is the default, means that no relay will be used (direct connection). See QuantumGate Relays for more details.
Relay::GatewayPeer Optionally the QuantumGate::PeerLUID of an existing connected peer through which to establish the relayed connection. If none is specified, QuantumGate will randomly choose an existing connection if available. For single hops the gateway peer should have the same endpoint as the PeerEndpoint (address and port should match). See QuantumGate Relays for more details.
Clone this wiki locally