Ejemplo n.º 1
0
void ServicePort::accept(Acceptor_ptr acceptor)
{
  try{
    boost::asio::ip::tcp::socket* socket = new boost::asio::ip::tcp::socket(m_io_service);

    acceptor->async_accept(*socket,
      boost::bind(&ServicePort::onAccept, this, acceptor, socket,
      boost::asio::placeholders::error));
  }
  catch(boost::system::system_error& e){
    if(m_logError){
      LOG_MESSAGE("NETWORK", LOGTYPE_ERROR, 1, e.what());
      m_logError = false;
    }
  }
}
Ejemplo n.º 2
0
void ServicePort::accept(Acceptor_ptr acceptor)
{
	try
	{
		boost::asio::ip::tcp::socket* socket = new boost::asio::ip::tcp::socket(m_io_service);
		acceptor->async_accept(*socket, boost::bind(
			&ServicePort::handle, this, acceptor, socket, boost::asio::placeholders::error));
	}
	catch(std::exception& e)
	{
		if(m_logError)
		{
			LOG_MESSAGE(LOGTYPE_ERROR, e.what(), "NETWORK")
			m_logError = false;
		}
	}
}