Files
Sun1602/Tools/SunUpdateManager/SunUpdateServer/AgentSession.cpp
T
2022-10-26 12:25:11 +08:00

34 lines
713 B
C++

#include "StdAfx.h"
#include ".\agentsession.h"
#include "PacketHandler.h"
#include "AgentSessionManager.h"
AgentSession::AgentSession(void)
{
}
AgentSession::~AgentSession(void)
{
}
VOID AgentSession::ProcessRecvPacket( BYTE* pMsg, int nSize )
{
if( !pMsg ) return;
//매니저에서 올수도 있고, Agent에서 올수도 있다.
PacketHandler::Instance()->ParserPacket_SA( (Session*)this, (MSG_BASE*)pMsg, nSize );
}
VOID AgentSession::OnConnect()
{
AgentSessionManager::Instance()->Add( this );
}
VOID AgentSession::OnClose()
{
//아직 AgentSessionManager에 들어가지 않은 상태에서 끊어 졌을수도 있다.
//아니면 이 함수를 종료하면서 여러번 호출 할수 도 있다.
AgentSessionManager::Instance()->Remove( this );
}