memgraph/speedy/http/httpconnection.inl

30 lines
574 B
Plaintext
Raw Normal View History

#ifndef MEMGRAPH_SERVER_HTTP_CONNECTION_INL
#define MEMGRAPH_SERVER_HTTP_CONNECTION_INL
#include <uv.h>
#include "httpconnection.hpp"
namespace http
{
2015-10-09 07:24:12 +08:00
template <class Req, class Res>
HttpConnection<Req, Res>::HttpConnection(uv::UvLoop& loop, server_t& server)
: server(server), client(loop), response(*this)
{
client.data(this);
parser.data(this);
}
2015-10-09 07:24:12 +08:00
template <class Req, class Res>
void HttpConnection<Req, Res>::close()
{
client.close([](uv_handle_t* client) -> void {
2015-10-09 07:24:12 +08:00
delete reinterpret_cast<connection_t*>(client->data);
});
}
}
#endif