2019-07-28 10:31:56 +08:00
|
|
|
#pragma once
|
2016-09-20 19:55:38 +08:00
|
|
|
|
|
|
|
class http_servlet : public acl::HttpServlet
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
http_servlet(acl::redis_client_cluster& cluster, size_t max_conns);
|
|
|
|
~http_servlet();
|
|
|
|
|
|
|
|
acl::session& get_session() const
|
|
|
|
{
|
|
|
|
return *session_;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
2016-10-21 15:02:50 +08:00
|
|
|
// @override
|
|
|
|
bool doError(acl::HttpServletRequest&, acl::HttpServletResponse&);
|
|
|
|
|
2016-09-20 19:55:38 +08:00
|
|
|
// @override
|
|
|
|
bool doUnknown(acl::HttpServletRequest&, acl::HttpServletResponse&);
|
|
|
|
|
|
|
|
// @override
|
|
|
|
bool doGet(acl::HttpServletRequest&, acl::HttpServletResponse&);
|
|
|
|
|
|
|
|
// @override
|
|
|
|
bool doPost(acl::HttpServletRequest&, acl::HttpServletResponse&);
|
|
|
|
|
|
|
|
// @override
|
2018-12-06 15:50:13 +08:00
|
|
|
bool doWebSocket(acl::HttpServletRequest&, acl::HttpServletResponse&);
|
2016-09-20 19:55:38 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
acl::session* session_;
|
|
|
|
|
|
|
|
bool doPing(acl::websocket&, acl::websocket&);
|
|
|
|
bool doPong(acl::websocket&, acl::websocket&);
|
|
|
|
bool doClose(acl::websocket&, acl::websocket&);
|
|
|
|
bool doMsg(acl::websocket&, acl::websocket&);
|
2019-12-13 16:46:28 +08:00
|
|
|
bool sendBannder(acl::websocket&);
|
2016-09-20 19:55:38 +08:00
|
|
|
};
|