MCPcopy Create free account
hub / github.com/acl-dev/acl / accept_callback

Method accept_callback

lib_acl_cpp/samples/mqtt/mqtt_aserver/main.cpp:375–388  ·  view source on GitHub ↗

@override

Source from the content-addressed store, hash-verified

373protected:
374 // @override
375 bool accept_callback(acl::aio_socket_stream* conn) {
376 printf("connect from %s, fd=%d\r\n", conn->get_peer(true),
377 conn->sock_handle());
378
379 acl::mqtt_aclient* client = new mqtt_client(handle_, manager_);
380 if (client->open(conn)) {
381 return true;
382 }
383
384 printf("open one mqtt client failed\r\n");
385 client->destroy();
386 conn->close();
387 return true;
388 }
389
390private:
391 acl::aio_handle& handle_;

Callers

nothing calls this directly

Calls 5

get_peerMethod · 0.45
sock_handleMethod · 0.45
openMethod · 0.45
destroyMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected