From bd768b92599d15329081215b0df964da2f15bdc9 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 26 Mar 2014 15:45:08 -0400 Subject: [PATCH] async receive --- HTTPServer.cpp | 3 +++ HTTPServer.h | 3 ++- Streaming.h | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/HTTPServer.cpp b/HTTPServer.cpp index 1628ff7b..30fb461b 100644 --- a/HTTPServer.cpp +++ b/HTTPServer.cpp @@ -277,6 +277,9 @@ namespace util } } + void HTTPConnection::HandleStreamReceive (const boost::system::error_code& ecode, std::size_t bytes_transferred) + { + } HTTPServer::HTTPServer (int port): m_Thread (nullptr), m_Work (m_Service), diff --git a/HTTPServer.h b/HTTPServer.h index 546f5bc2..b966db81 100644 --- a/HTTPServer.h +++ b/HTTPServer.h @@ -44,7 +44,8 @@ namespace util void Terminate (); void Receive (); - void HandleReceive (const boost::system::error_code& ecode, std::size_t bytes_transferred); + void HandleReceive (const boost::system::error_code& ecode, std::size_t bytes_transferred); + void HandleStreamReceive (const boost::system::error_code& ecode, std::size_t bytes_transferred); void HandleWrite(const boost::system::error_code& ecode); void HandleRequest (); diff --git a/Streaming.h b/Streaming.h index 37195ebb..8de2d241 100644 --- a/Streaming.h +++ b/Streaming.h @@ -201,7 +201,7 @@ namespace stream void Stream::AsyncReceive (const Buffer& buffer, ReceiveHandler handler, int timeout) { m_ReceiveTimer.expires_from_now (boost::posix_time::seconds(timeout)); - m_ReceiveTimer.async_wait (boost::bind (&Stream::HandleReceiveTimer, + m_ReceiveTimer.async_wait (boost::bind (&Stream::HandleReceiveTimer, this, boost::asio::placeholders::error, buffer, handler)); }