Ditto 4.13.1
 
Loading...
Searching...
No Matches
ditto::DittoConfig::Connect Class Referenceabstract

Specifies how this instance discovers and connects to peers, including network settings and authentication options. More...

Inheritance diagram for ditto::DittoConfig::Connect:
ditto::DittoConfig::ServerConnect ditto::DittoConfig::SmallPeersOnlyConnect

Public Types

enum class  Type { server , small_peers_only }
 Connection configuration type.
 

Public Member Functions

virtual Type get_type () const =0
 

Static Public Member Functions

static std::shared_ptr< Connectserver (std::string url)
 Factory method to create a server connection.
 
static std::shared_ptr< Connectsmall_peers_only (std::string private_key="")
 Factory method to create a small-peers-only connection.
 

Detailed Description

Specifies how this instance discovers and connects to peers, including network settings and authentication options.

This is a substructure of DittoConfig.

Connect is an abstract class. Concrete derived classes are ServerConnect and SmallPeersOnlyConnect.

Member Function Documentation

◆ server()

static std::shared_ptr< Connect > ditto::DittoConfig::Connect::server ( std::string url)
static

Factory method to create a server connection.

Parameters
urlThe server URL
Returns
A shared pointer to a Connect instance configured for server connection

◆ small_peers_only()

static std::shared_ptr< Connect > ditto::DittoConfig::Connect::small_peers_only ( std::string private_key = "")
static

Factory method to create a small-peers-only connection.

Parameters
private_keyOptional private key for encryption (empty string means no encryption)
Returns
A shared pointer to a Connect instance configured for small peers only