void
HttpConnection::close() {
+ request_timer_.cancel();
socket_.close();
}
void
HttpConnection::asyncAccept() {
+ // Create instance of the callback. It is safe to pass the local instance
+ // of the callback, because the underlying boost functions make copies
+ // as needed.
HttpAcceptorCallback cb = boost::bind(&HttpConnection::acceptorCallback,
shared_from_this(),
boost::asio::placeholders::error);
HttpConnection::doRead() {
try {
TCPEndpoint endpoint;
+ // Create instance of the callback. It is safe to pass the local instance
+ // of the callback, because the underlying boost functions make copies
+ // as needed.
SocketCallback cb(boost::bind(&HttpConnection::socketReadCallback,
shared_from_this(),
boost::asio::placeholders::error,
HttpConnection::doWrite() {
try {
if (!output_buf_.empty()) {
+ // Create instance of the callback. It is safe to pass the local instance
+ // of the callback, because the underlying boost functions make copies
+ // as needed.
SocketCallback cb(boost::bind(&HttpConnection::socketWriteCallback,
shared_from_this(),
boost::asio::placeholders::error,