| 13 | namespace toft { |
| 14 | |
| 15 | HttpConnection::HttpConnection(EventDispatcher* dispatcher, int fd) |
| 16 | : m_watcher(dispatcher, std::bind(&HttpConnection::OnIoEvents, this, |
| 17 | std::placeholders::_1), |
| 18 | fd, EventMask_Read), |
| 19 | m_sent_size(0) { |
| 20 | m_socket.Attach(fd); |
| 21 | m_watcher.Start(); |
| 22 | } |
| 23 | |
| 24 | void HttpConnection::Send(const StringPiece& data) { |
| 25 | m_send_queue.push_back(data.as_string()); |