MCPcopy Create free account
hub / github.com/TelegramMessenger/cocoon / Callback

Class Callback

net/TcpClient.cpp:203–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201 auto listening_socket = std::make_unique<TcpListeningSocket>(listening_socket_id, port, remote_app_type);
202
203 class Callback : public td::TcpListener::Callback {
204 private:
205 td::actor::ActorId<TcpClientImpl> id_;
206 ListeningSocketId listening_socket_id_;
207
208 public:
209 Callback(td::actor::ActorId<TcpClientImpl> id, ListeningSocketId listening_socket_id)
210 : id_(id), listening_socket_id_(listening_socket_id) {
211 }
212 void accept(td::SocketFd fd) override {
213 td::actor::send_closure(id_, &TcpClientImpl::accepted_tcp_connection, td::BufferedFd<td::SocketFd>(std::move(fd)),
214 listening_socket_id_);
215 }
216 };
217
218 listening_socket->listener = td::actor::create_actor<td::TcpInfiniteListener>(
219 td::actor::ActorOptions().with_name("listener").with_poll(), port,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected