This commit is contained in:
aozhiwei 2023-04-24 11:01:29 +08:00
parent 6001cb8e02
commit 54336693e4
3 changed files with 13 additions and 3 deletions

View File

@ -1,8 +1,17 @@
#include "precompile.h" #include "precompile.h"
#include "downstream.h" #include "downstream.h"
#include "upstream.h"
#include "ss_proto.pb.h"
void DownStream::ForwardUpStreamMsg(f8::MsgHdr& hdr) void DownStream::ForwardUpStreamMsg(f8::MsgHdr& hdr)
{ {
} }
void DownStream::OnClose()
{
ss::SS_WSP_SocketDisconnect msg;
conn.lock()->SendMsg(socket_handle, msg);
}

View File

@ -8,6 +8,7 @@ class DownStream
std::weak_ptr<UpStream> conn; std::weak_ptr<UpStream> conn;
void ForwardUpStreamMsg(f8::MsgHdr& hdr); void ForwardUpStreamMsg(f8::MsgHdr& hdr);
void OnClose();
private: private:
int type_ = 0; int type_ = 0;

View File

@ -44,8 +44,7 @@ void DownStreamMgr::OnClientDisconnect(int socket_handle)
auto down_wp = GetDownStream(socket_handle); auto down_wp = GetDownStream(socket_handle);
if (auto down = down_wp.lock(); !down_wp.expired()) { if (auto down = down_wp.lock(); !down_wp.expired()) {
if (!down->conn.expired()) { if (!down->conn.expired()) {
ss::SS_WSP_SocketDisconnect msg; down->OnClose();
down->conn.lock()->SendMsg(socket_handle, msg);
} }
socket_hash_.erase(socket_handle); socket_hash_.erase(socket_handle);
} }
@ -123,7 +122,8 @@ void DownStreamMgr::AddPendingAccount(const std::string& account_id, int socket_
{ {
if (a8::TIMER_EXEC_EVENT == event) { if (a8::TIMER_EXEC_EVENT == event) {
pending_account_hash_.erase(socket_handle); pending_account_hash_.erase(socket_handle);
App::Instance()->perf.max_join_time = std::max((long long)1000 * 10, App::Instance()->perf.max_join_time); App::Instance()->perf.max_join_time =
std::max((long long)1000 * 10, App::Instance()->perf.max_join_time);
} }
}, },
&timer_attacher_ &timer_attacher_