5 #ifndef SRC_IO_TCP_MESSAGE_WRITE_H_
6 #define SRC_IO_TCP_MESSAGE_WRITE_H_
11 #include <boost/asio.hpp>
12 #include <boost/bind.hpp>
13 #include <boost/asio/buffer.hpp>
14 #include <boost/intrusive_ptr.hpp>
15 #include <boost/system/error_code.hpp>
31 int Send(
const uint8_t *msg,
size_t len,
32 boost::system::error_code *ec);
34 int AsyncSend(
const uint8_t *msg,
size_t len,
35 boost::system::error_code *ec);
46 boost::asio::mutable_buffer buffer = *it;
47 total += buffer_size(buffer);
69 #endif // SRC_IO_TCP_MESSAGE_WRITE_H_
bool UpdateBufferQueue(size_t wrote, bool *send_ready)
static const int kDefaultBufferSize
int Send(const uint8_t *msg, size_t len, boost::system::error_code *ec)
void BufferAppend(const uint8_t *data, int len)
boost::intrusive_ptr< TcpSession > TcpSessionPtr
std::list< boost::asio::mutable_buffer > BufferQueue
void DeleteBuffer(boost::asio::mutable_buffer buffer)
BufferQueue buffer_queue_
bool IsWritePending() const
static const int kMaxPendingBufferSize
TcpMessageWriter(TcpSession *session, size_t buffer_send_size)
size_t GetBufferQueueSize() const
int AsyncSend(const uint8_t *msg, size_t len, boost::system::error_code *ec)
static const int kDefaultWriteBufferSize
static const int kMinPendingBufferSize