From 2f5c158c53a41184c4e4db9ff41acc43ca0ec4b6 Mon Sep 17 00:00:00 2001 From: azw Date: Sat, 22 Apr 2023 07:59:26 +0000 Subject: [PATCH] 1 --- server/wsproxy/app.cc | 10 ++++++++-- server/wsproxy/longsessionmgr.cc | 5 +++++ server/wsproxy/longsessionmgr.h | 6 ++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/server/wsproxy/app.cc b/server/wsproxy/app.cc index 165e5d3..21736a5 100644 --- a/server/wsproxy/app.cc +++ b/server/wsproxy/app.cc @@ -20,14 +20,18 @@ #include "handlermgr.h" #include "downstream.h" #include "downstreammgr.h" -#include "ss_msgid.pb.h" -#include "ss_proto.pb.h" #include "upstream.h" #include "upstreammgr.h" #include "master.h" #include "mastermgr.h" +#include "longsessionmgr.h" + +#include "ss_msgid.pb.h" +#include "ss_proto.pb.h" + + struct MsgNode { SocketFrom_e sockfrom; @@ -120,6 +124,7 @@ bool App::Init(int argc, char* argv[]) DownStreamMgr::Instance()->Init(); MasterMgr::Instance()->Init(); UpStreamMgr::Instance()->Init(); + LongSessionMgr::Instance()->Init(); GCListener::Instance()->Init(); f8::UdpLog::Instance()->Info("wsproxy starting instance_id:%d pid:%d", @@ -174,6 +179,7 @@ void App::UnInit() { a8::XPrintf("wsproxy terminating instance_id:%d pid:%d\n", {instance_id, getpid()}); GCListener::Instance()->UnInit(); + LongSessionMgr::Instance()->UnInit(); MasterMgr::Instance()->UnInit(); UpStreamMgr::Instance()->UnInit(); DownStreamMgr::Instance()->UnInit(); diff --git a/server/wsproxy/longsessionmgr.cc b/server/wsproxy/longsessionmgr.cc index 1a62c21..6ec639b 100644 --- a/server/wsproxy/longsessionmgr.cc +++ b/server/wsproxy/longsessionmgr.cc @@ -11,3 +11,8 @@ void LongSessionMgr::UnInit() { } + +std::shared_ptr GetSessionBySocketHandle(int socket_handle) +{ + return nullptr; +} diff --git a/server/wsproxy/longsessionmgr.h b/server/wsproxy/longsessionmgr.h index fabdbae..f099339 100644 --- a/server/wsproxy/longsessionmgr.h +++ b/server/wsproxy/longsessionmgr.h @@ -2,6 +2,7 @@ #include +class LongSession; class LongSessionMgr : public a8::Singleton { private: @@ -13,4 +14,9 @@ class LongSessionMgr : public a8::Singleton void Init(); void UnInit(); + std::shared_ptr GetSessionBySocketHandle(int socket_handle); + +private: + + std::map> session_hash_; };