MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / OnAccept

Method OnAccept

include/server/server.hpp:177–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175 }
176
177 void OnAccept(boost::beast::error_code ec, boost::asio::ip::tcp::socket socket)
178 {
179 if (!ec)
180 {
181 // Create the connection and start it
182 auto connection = std::make_shared<Connection>(
183 std::move(socket), request_handler, max_header_size, keepalive_timeout);
184
185 connection->start();
186 }
187 else if (ec != boost::asio::error::operation_aborted)
188 {
189 util::Log(logERROR) << "Accept error: " << ec.message();
190 }
191
192 // Accept another connection
193 if (acceptor.is_open())
194 {
195 DoAccept();
196 }
197 }
198
199 RequestHandler request_handler;
200 unsigned thread_pool_size;

Callers 1

DoAcceptMethod · 0.95

Calls 3

LogClass · 0.85
messageMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected