MCPcopy Create free account
hub / github.com/boostorg/asio / server

Function server

example/cpp14/echo/blocking_tcp_echo_server.cpp:46–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void server(boost::asio::io_context& io_context, unsigned short port)
47{
48 tcp::acceptor a(io_context, tcp::endpoint(tcp::v4(), port));
49 for (;;)
50 {
51 tcp::socket sock(io_context);
52 a.accept(sock);
53 std::thread(session, std::move(sock)).detach();
54 }
55}
56
57int main(int argc, char* argv[])
58{

Callers 1

mainFunction · 0.70

Calls 3

detachMethod · 0.80
endpointClass · 0.50
acceptMethod · 0.45

Tested by

no test coverage detected