/**
	 * Run when new connection is accepted
	 *
	 * @param new_connection accepted connection
	 * @param error reference to error object
	 */
	void handle_accept(connection::pointer new_connection,
					   const boost::system::error_code& error) 	{
		if (!error) {
			new_connection->start();
			start_accept();
		}
	}
Пример #2
0
void server::handle_accept(connection::pointer new_connection, const bs::error_code& error) {
  //	std::cout << "server::handle_accept" << std::endl;
  if (!error) {
    new_connection->start();
    start_accept();
  }
}
Пример #3
0
  void handle_accept(connection::pointer new_connection,
      const asio::error_code& error)
  {
    if (!error)
    {
      new_connection->start();
    }

    start_accept();
  }
Пример #4
0
void Server::accept(Connection::pointer connection, const boost::system::error_code& error)
{
    std::string ip = connection->socket().remote_endpoint().address().to_v4().to_string();
    std::cout << "-----------------------------------------\n";
    std::cout << "New request coming from " << ip << std::endl;
    if (!error)
        connection->start();
    else
        std::cout << "Server accept error : " << error.message() << std::endl;
    listen();
}