MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / serve

Method serve

src/ipc/capnp/protocol.cpp:93–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers 2

startSpawnedProcessMethod · 0.80
IpcSocketPairTestFunction · 0.80

Calls 6

ThreadNameFunction · 0.85
GetRequestedIPCLogLevelFunction · 0.85
emplaceMethod · 0.80
loopMethod · 0.80
backMethod · 0.45
resetMethod · 0.45

Tested by 1

IpcSocketPairTestFunction · 0.64