4 #include <boost/asio.hpp> 7 #include "connection/connection_manager.h" 9 using boost::asio::ip::tcp;
22 Server(int32_t port, database_ptr _db):
23 endpoint(boost::asio::ip::tcp::v4(), port),
24 acceptor(io_service, endpoint),
39 boost::asio::io_service io_service;
40 boost::asio::ip::tcp::endpoint endpoint;
41 boost::asio::ip::tcp::acceptor acceptor;
50 void scan_acception() {
51 acceptor.async_accept([
this](
const boost::system::error_code& error, tcp::socket sock) {
Async TCP Server.
Definition: server.h:15
ConnectionManager.
Definition: connection_manager.h:10
connection_ptr get_connection(boost::asio::ip::tcp::socket &&_socket)
get new or old connection for new client
Definition: connection_manager.cpp:4
Server(int32_t port, database_ptr _db)
Construct a new Server object.
Definition: server.h:22
void run()
Run server.
Definition: server.h:34