Support data streaming on server side.

This commit is contained in:
Chunting Gu
2019-08-13 17:35:01 +08:00
parent 0ea4ab7526
commit 9b13dceab9
13 changed files with 167 additions and 59 deletions
+5 -1
View File
@@ -24,7 +24,7 @@ using ConnectionPtr = std::shared_ptr<Connection>;
class Connection : public std::enable_shared_from_this<Connection> {
public:
Connection(boost::asio::ip::tcp::socket socket, ConnectionPool* pool,
Queue<ConnectionPtr>* queue);
Queue<ConnectionPtr>* queue, ViewMatcher&& view_matcher);
~Connection() = default;
@@ -71,6 +71,10 @@ private:
// The connection queue.
Queue<ConnectionPtr>* queue_;
// A function for matching view once the headers of a request has been
// received.
ViewMatcher view_matcher_;
// The buffer for incoming data.
std::vector<char> buffer_;