| 50 | std::unique_ptr<TcpConnection::Callback> TcpClientImpl::make_tcp_connection_callback( |
| 51 | TcpClient::ConnectionId connection_id) { |
| 52 | class Cb : public TcpConnection::Callback { |
| 53 | private: |
| 54 | td::actor::ActorId<TcpClientImpl> id_; |
| 55 | ConnectionId connection_id_; |
| 56 | |
| 57 | public: |
| 58 | void on_ready(td::actor::ActorId<TcpConnection> conn, const RemoteAppType &remote_app_type, |
| 59 | const td::Bits256 &remote_app_hash, const td::Bits256 &verified_by) override { |
| 60 | td::actor::send_closure(id_, &TcpClientImpl::conn_ready, connection_id_, remote_app_type, remote_app_hash, |
| 61 | verified_by); |
| 62 | } |
| 63 | void on_close(td::actor::ActorId<TcpConnection> conn) override { |
| 64 | td::actor::send_closure(id_, &TcpClientImpl::conn_stopped, connection_id_); |
| 65 | } |
| 66 | void on_packet(td::actor::ActorId<TcpConnection> conn, td::BufferSlice data) override { |
| 67 | td::actor::send_closure(id_, &TcpClientImpl::process_packet, connection_id_, std::move(data)); |
| 68 | } |
| 69 | void on_query(td::actor::ActorId<TcpConnection> conn, td::int64 query_id, td::BufferSlice data) override { |
| 70 | td::actor::send_closure(id_, &TcpClientImpl::process_query, connection_id_, query_id, std::move(data)); |
| 71 | } |
| 72 | void on_query_answer(td::actor::ActorId<TcpConnection> conn, td::int64 query_id, td::BufferSlice data) override { |
| 73 | td::actor::send_closure(id_, &TcpClientImpl::process_query_answer, connection_id_, query_id, std::move(data)); |
| 74 | } |
| 75 | void on_query_error(td::actor::ActorId<TcpConnection> conn, td::int64 query_id, td::Status error) override { |
| 76 | td::actor::send_closure(id_, &TcpClientImpl::process_query_error, connection_id_, query_id, std::move(error)); |
| 77 | } |
| 78 | Cb(td::actor::ActorId<TcpClientImpl> id, ConnectionId connection_id) : id_(id), connection_id_(connection_id) { |
| 79 | } |
| 80 | }; |
| 81 | return std::make_unique<Cb>(actor_id(this), connection_id); |
| 82 | } |
| 83 |
nothing calls this directly
no outgoing calls
no test coverage detected