|
|
| PeerDiscovery (in_port_t port=DEFAULT_PORT, std::shared_ptr< asio::io_context > ioContext={}, std::shared_ptr< Logger > logger={}) |
| void | startDiscovery (std::string_view type, ServiceDiscoveredCallback callback) |
| template<typename T> |
| void | startDiscovery (std::string_view type, std::function< void(T &&, SockAddr &&)> cb) |
| void | startPublish (std::string_view type, const msgpack::sbuffer &pack_buf) |
|
void | startPublish (sa_family_t domain, std::string_view type, const msgpack::sbuffer &pack_buf) |
| template<typename T> |
| void | startPublish (std::string_view type, const T &object) |
| void | stop () |
| bool | stopDiscovery (std::string_view type) |
| bool | stopPublish (std::string_view type) |
|
bool | stopPublish (sa_family_t domain, std::string_view type) |
|
void | connectivityChanged () |
|
void | stopConnectivityChanged () |
Definition at line 37 of file peer_discovery.h.
◆ ServiceDiscoveredCallback
| using dht::PeerDiscovery::ServiceDiscoveredCallback = std::function<void(msgpack::object &&, SockAddr &&)> |
◆ startDiscovery() [1/2]
| void dht::PeerDiscovery::startDiscovery |
( |
std::string_view | type, |
|
|
ServiceDiscoveredCallback | callback ) |
startDiscovery - Keep Listening data from the sender until node is joinned or stop is called
◆ startDiscovery() [2/2]
template<typename T>
| void dht::PeerDiscovery::startDiscovery |
( |
std::string_view | type, |
|
|
std::function< void(T &&, SockAddr &&)> | cb ) |
|
inline |
◆ startPublish() [1/2]
| void dht::PeerDiscovery::startPublish |
( |
std::string_view | type, |
|
|
const msgpack::sbuffer & | pack_buf ) |
startPublish - Keeping sending data until node is joinned or stop is called
◆ startPublish() [2/2]
template<typename T>
| void dht::PeerDiscovery::startPublish |
( |
std::string_view | type, |
|
|
const T & | object ) |
|
inline |
◆ stop()
| void dht::PeerDiscovery::stop |
( |
| ) |
|
◆ stopDiscovery()
| bool dht::PeerDiscovery::stopDiscovery |
( |
std::string_view | type | ) |
|
Remove possible callBack to discovery
◆ stopPublish()
| bool dht::PeerDiscovery::stopPublish |
( |
std::string_view | type | ) |
|
Remove different serivce message to send
◆ DEFAULT_PORT
| in_port_t dht::PeerDiscovery::DEFAULT_PORT = 8888 |
|
staticconstexpr |
The documentation for this class was generated from the following file:
- /home/noptrix/ba/blackarch/packages/opendht-c/src/opendht/include/opendht/peer_discovery.h