19 #ifndef MIR_FRONTEND_PROTOBUF_ASIO_COMMUNICATOR_H_ 20 #define MIR_FRONTEND_PROTOBUF_ASIO_COMMUNICATOR_H_ 24 #include <boost/asio.hpp> 40 class EmergencyCleanupRegistry;
44 class ConnectionCreator;
45 class ConnectorReport;
52 std::shared_ptr<ConnectionCreator>
const& connection_creator,
53 std::shared_ptr<ConnectorReport>
const& report);
55 void start()
override;
57 int client_socket_fd()
const override;
58 int client_socket_fd(std::function<
void(std::shared_ptr<Session>
const& session)>
const& connect_handler)
const override;
61 void create_session_for(
62 std::shared_ptr<boost::asio::local::stream_protocol::socket>
const& server_socket,
63 std::function<
void(std::shared_ptr<Session>
const& session)>
const& connect_handler)
const;
66 boost::asio::io_service::work
work;
67 std::shared_ptr<ConnectorReport>
const report;
70 std::thread io_service_thread;
71 std::shared_ptr<ConnectionCreator>
const connection_creator;
79 const std::string& socket_file,
80 std::shared_ptr<ConnectionCreator>
const& connection_creator,
82 std::shared_ptr<ConnectorReport>
const& report);
87 void on_new_connection(std::shared_ptr<boost::asio::local::stream_protocol::socket>
const& socket,
88 boost::system::error_code
const& ec);
90 const std::string socket_file;
91 boost::asio::local::stream_protocol::acceptor acceptor;
96 #endif // MIR_FRONTEND_PROTOBUF_ASIO_COMMUNICATOR_H_ Handle client process connections.
Definition: connector.h:32
All things Mir.
Definition: atomic_callback.h:25
boost::asio::io_service::work work
Definition: published_socket_connector.h:66
std::shared_ptr< ConnectorReport > const report
Definition: published_socket_connector.h:67
provides a client-side socket fd for each connection
Definition: published_socket_connector.h:48
boost::asio::io_service io_service
Definition: published_socket_connector.h:65
std::promise< bool > stop
Definition: in.cpp:28
Definition: emergency_cleanup_registry.h:32
Accept connections over a published socket.
Definition: published_socket_connector.h:75
Definition: buffer_stream.h:37