CConnman::PrivateBroadcast

Group of private broadcast related members.

Synopsis

Declared in <net.h>

class PrivateBroadcast;

Member Functions

NameDescription
NumToOpen Get the pending number of connections to open.
NumToOpenAdd Increment the number of new connections of type ConnectionType::PRIVATE_BROADCAST to be opened by CConnman::ThreadPrivateBroadcast().
NumToOpenSub Decrement the number of new connections of type ConnectionType::PRIVATE_BROADCAST to be opened by CConnman::ThreadPrivateBroadcast().
NumToOpenWait Wait for the number of needed connections to become greater than 0.
PickNetwork Choose a network to open a connection to.

Data Members

NameDescription
m_outbound_tor_ok_at_least_once Remember if we ever established at least one outbound connection to a Tor peer, including sending and receiving P2P messages. If this is true then the Tor proxy indeed works and is a proxy to the Tor network, not a misconfigured ordinary SOCKS5 proxy as -proxy or -onion. If that is the case, then we assume that connecting to an IPv4 or IPv6 address via that proxy will be done through the Tor network and a Tor exit node.
m_sem_conn_max Semaphore used to guard against opening too many connections. Opening private broadcast connections will be paused if this is equal to 0.

Protected Member Functions

NameDescription
ProxyForIPv4or6 Check if private broadcast can be done to IPv4 or IPv6 peers and if so via which proxy. If private broadcast connections should not be opened to IPv4 or IPv6, then this will return an empty optional.

Protected Data Members

NameDescription
m_num_to_open Number of ConnectionType::PRIVATE_BROADCAST connections to open.

Friends

NameDescription
ConnmanTestMsgTest harness that exposes CConnman internals for unit tests.