4 #include <boost/asio.hpp>
6 #include <boost/circular_buffer.hpp>
27 const boost::asio::ip::tcp::endpoint& endpoint,
38 LOG_ERROR <<
"Connection to " << m_endpoint <<
" failed";
106 boost::system::error_code ec;
111 boost::asio::socket_base::send_buffer_size option(67108864);
112 m_sock.set_option(option);
113 boost::asio::socket_base::non_blocking_io command(
true);
114 m_sock.io_control(command);
116 boost::system::error_code ec;
117 m_sock.shutdown(boost::asio::ip::tcp::socket::shutdown_receive, ec);
123 boost::system::error_code ec;
124 m_sock.shutdown(boost::asio::ip::tcp::socket::shutdown_send, ec);
135 boost::system::error_code ec;
140 if(ec.value()==11 && nsent<100){
143 " gives EAGAIN: stop sending frame for the heartbeat interval in order to prevent strong RAM usage";
144 }
else if(ec.value()!=11)
152 #endif // RECIPIENT_HH
boost::circular_buffer< Frame > CircularBuffer
Recipient(boost::asio::io_service &service, const boost::asio::ip::tcp::endpoint &endpoint, size_t circbuff_size)
boost::asio::ip::tcp::socket m_sock
const long heartbeat_interval
bool send(const Frame &data)
Send data.
bool sendIfPossible(const Frame &data)
boost::asio::ip::tcp::endpoint m_endpoint
unsigned int getFrameLength() const
bool write(const Vec &v, std::ostream &os)
Write a Vec(tor) to a stream.
Template Frame for ARS data.