| 91 | mp::ListenConnections<messages::Init>(*m_loop, listen_fd, init); |
| 92 | } |
| 93 | void serve(int fd, const char* exe_name, interfaces::Init& init, const std::function<void()>& ready_fn = {}) override |
| 94 | { |
| 95 | assert(!m_loop); |
| 96 | mp::g_thread_context.thread_name = mp::ThreadName(exe_name); |
| 97 | mp::LogOptions opts = { |
| 98 | .log_fn = IpcLogFn, |
| 99 | .log_level = GetRequestedIPCLogLevel() |
| 100 | }; |
| 101 | m_loop.emplace(exe_name, std::move(opts), &m_context); |
| 102 | if (ready_fn) ready_fn(); |
| 103 | mp::ServeStream<messages::Init>(*m_loop, fd, init); |
| 104 | m_parent_connection = &m_loop->m_incoming_connections.back(); |
| 105 | m_loop->loop(); |
| 106 | m_loop.reset(); |
| 107 | } |
| 108 | void disconnectIncoming() override |
| 109 | { |
| 110 | if (!m_loop) return; |