Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
void TcpBase::update(boost::asio::ip::tcp::socket& s) {
    s.non_blocking(true);
    this->sendQueuedMessages(s);
    this->receiveMessages(s);
}