|
My Project 3.7.9
C++ Distributed Hash Table
|

Public Member Functions | |
| Node (const InfoHash &id, const SockAddr &addr, std::mt19937_64 &rd, bool client=false) | |
| Node (const InfoHash &id, SockAddr &&addr, std::mt19937_64 &rd, bool client=false) | |
| Node (const InfoHash &id, const sockaddr *sa, socklen_t salen, std::mt19937_64 &rd) | |
| const InfoHash & | getId () const |
| const SockAddr & | getAddr () const |
| std::string | getAddrStr () const |
| bool | isClient () const |
| bool | isIncoming () |
| const time_point & | getTime () const |
| const time_point & | getReplyTime () const |
| void | setTime (const time_point &t) |
| void | authError () |
| void | authSuccess () |
| bool | isExpired () const |
| bool | isGood (time_point now) const |
| bool | isPendingMessage () const |
| size_t | getPendingMessageCount () const |
| bool | isOld (const time_point &now) const |
| bool | isRemovable (const time_point &now) const |
| NodeExport | exportNode () const |
| sa_family_t | getFamily () const |
| void | update (const SockAddr &) |
| void | requested (const Sp< net::Request > &req) |
| void | received (time_point now, const Sp< net::Request > &req) |
| Sp< net::Request > | getRequest (Tid tid) |
| void | cancelRequest (const Sp< net::Request > &req) |
| void | setExpired () |
| Tid | openSocket (SocketCb &&cb) |
| Sp< Socket > | getSocket (Tid id) |
| void | closeSocket (Tid id) |
| void | reset () |
| Tid | getNewTid () |
| std::string | toString () const |
Public Attributes | |
| const InfoHash | id |
Static Public Attributes | |
| static constexpr const std::chrono::minutes | NODE_GOOD_TIME {120} |
| static constexpr const std::chrono::minutes | NODE_EXPIRE_TIME {10} |
| static constexpr const std::chrono::seconds | MAX_RESPONSE_TIME {1} |
Friends | |
| OPENDHT_PUBLIC friend std::ostream & | operator<< (std::ostream &s, const Node &h) |
|
inline |
|
inline |
| void dht::Node::closeSocket | ( | Tid | id | ) |
Closes a socket so that no further data will be red on that socket.
| socket | The socket to close. |
|
inline |
|
inline |
|
inline |
| Tid dht::Node::openSocket | ( | SocketCb && | cb | ) |
Opens a socket on which a node will be able allowed to write for further additionnal updates following the response to a previous request.
| node | The node which will be allowed to write on this socket. |
| cb | The callback to execute once updates arrive on the socket. |
|
inline |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |