示例#1
0
 void socket_options(boost::asio::ip::tcp::socket &socket) {
   boost::system::error_code ignored;
   socket.non_blocking(non_blocking_io);
   socket.set_option(linger, ignored);
   if (receive_buffer_size) socket.set_option(*receive_buffer_size, ignored);
   if (receive_low_watermark)
     socket.set_option(*receive_low_watermark, ignored);
   if (send_buffer_size) socket.set_option(*send_buffer_size, ignored);
   if (send_low_watermark) socket.set_option(*send_low_watermark, ignored);
 }
示例#2
0
void TCPClient::setupSocket(boost::asio::ip::tcp::socket& socket)
{
	if (!_setup_socket)
	{
		_setup_socket = true;
		socket.set_option(boost::asio::ip::tcp::no_delay(true));
	}
}
		void	applySocketOpts(boost::system::error_code& set_option_err)
		{
			socket.set_option(boost::asio::ip::tcp::no_delay(true), set_option_err);
			if (set_option_err){
				//std::cerr << "socket.set_option => " << set_option_err.message() << std::endl;
				LOG_ERR << "socket.set_option => " << set_option_err.message();
			}
			/*
			socket.set_option( boost::asio::socketbase::send_buffer_size( 65536 ) ,set_option_err);
			if(set_option_err){
			std::cerr <<"socket.set_option => " << set_option_err.message() <<std::endl;
			}
			socket.set_option( boost::asio::socketbase::receive_buffer_size( 65536 ),set_option_err );
			if(set_option_err){
			std::cerr <<"socket.set_option => " << set_option_err.message() <<std::endl;
			}
			*/
		}
void Server::OnSocketInit(ConnectionHandle connection, boost::asio::ip::tcp::socket& s)
{
    // Disable Nagle's algorithm from each connection to avoid delays in sync
    boost::asio::ip::tcp::no_delay option(true);
    s.set_option(option);
}
void on_socket_init(websocketpp::connection_hdl hdl, boost::asio::ip::tcp::socket & s) {
    boost::asio::ip::tcp::no_delay option(true);
    s.set_option(option);
}
示例#6
0
void Webserver::onSocketInit(connection_hdl hdl, boost::asio::ip::tcp::socket &s) {
  boost::asio::ip::tcp::no_delay option(true);
  s.set_option(option);
}