EnHandleResult CSSLServer::FireReceive(TSocketObj* pSocketObj, const BYTE* pData, int iLength) { CSSLSession* pSession = nullptr; GetConnectionReserved2(pSocketObj, (PVOID*)&pSession); ASSERT(pSession); return ::ProcessReceive(this, pSocketObj, pSession, pData, iLength); }
EnHandleResult CSSLServer::FireClose(TSocketObj* pSocketObj, EnSocketOperation enOperation, int iErrorCode) { EnHandleResult result = DoFireClose(pSocketObj, enOperation, iErrorCode); CSSLSession* pSession = nullptr; GetConnectionReserved2(pSocketObj, (PVOID*)&pSession); ASSERT(pSession); if(pSession != nullptr) m_sslPool.PutFreeSession(pSession); return result; }
BOOL CSSLServer::SendPackets(CONNID dwConnID, const WSABUF pBuffers[], int iCount) { ASSERT(pBuffers && iCount > 0); TSocketObj* pSocketObj = FindSocketObj(dwConnID); if(!TSocketObj::IsValid(pSocketObj)) { ::SetLastError(ERROR_OBJECT_NOT_FOUND); return FALSE; } CSSLSession* pSession = nullptr; GetConnectionReserved2(pSocketObj, (PVOID*)&pSession); return ::ProcessSend(this, pSocketObj, pSession, pBuffers, iCount); }
BOOL CTcpAgent::GetConnectionReserved2(CONNID dwConnID, PVOID* ppReserved2) { TSocketObj* pSocketObj = FindSocketObj(dwConnID); return GetConnectionReserved2(pSocketObj, ppReserved2); }