| 24 | void P2PProtocol::update_my_port(uint16_t port) { return m_client->update_my_port(port); } |
| 25 | |
| 26 | P2PClient::P2PClient(bool incoming, D_handler &&d_handler) |
| 27 | : sock([this](bool canread, bool canwrite) { advance_state(true); }, |
| 28 | std::bind(&P2PClient::on_socket_disconnect, this)) |
| 29 | , incoming(incoming) |
| 30 | , d_handler(std::move(d_handler)) |
| 31 | , buffer(RECOMMENDED_BUFFER_SIZE) {} |
| 32 | |
| 33 | void P2PClient::set_protocol(std::unique_ptr<P2PProtocol> &&protocol) { |
| 34 | bool protocol_switch = protocol && m_protocol; |
nothing calls this directly
no outgoing calls
no test coverage detected