From f4e2c7f0603fdb0609bf163ee5ea683a44b98d69 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 20 Mar 2012 21:42:09 +0900 Subject: Added JSON-RPC over WebSocket. Wslay library must be placed under deps/wslay. --- src/WebSocketSessionMan.h | 71 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 src/WebSocketSessionMan.h (limited to 'src/WebSocketSessionMan.h') diff --git a/src/WebSocketSessionMan.h b/src/WebSocketSessionMan.h new file mode 100644 index 00000000..8004b485 --- /dev/null +++ b/src/WebSocketSessionMan.h @@ -0,0 +1,71 @@ +/* */ +#ifndef D_WEB_SOCKET_SESSION_MAN_H +#define D_WEB_SOCKET_SESSION_MAN_H + +#include "common.h" + +#include +#include + +#include "SharedHandle.h" +#include "a2functional.h" + +namespace aria2 { + +class RequestGroup; + +namespace rpc { + +class WebSocketSession; + +class WebSocketSessionMan { +public: + typedef std::set, + RefLess > WebSocketSessions; + WebSocketSessionMan(); + ~WebSocketSessionMan(); + void addSession(const SharedHandle& wsSession); + void removeSession(const SharedHandle& wsSession); + void addNotification(const std::string& method, const RequestGroup* group); +private: + WebSocketSessions sessions_; +}; + +} // namespace rpc + +} // aria2 + +#endif // D_WEB_SOCKET_SESSION_MAN_H -- cgit