void C4Network2Client::RemoveConn(C4Network2IOConnection *pConn) { if (pConn == pMsgConn) { pMsgConn->DelRef(); pMsgConn = NULL; } if (pConn == pDataConn) { pDataConn->DelRef(); pDataConn = NULL; } if (pMsgConn && !pDataConn) SetDataConn(pMsgConn); if (!pMsgConn && pDataConn) SetMsgConn(pDataConn); }
void C4Network2Client::SetMsgConn(C4Network2IOConnection *pConn) { // security if (pConn != pMsgConn) { if (pMsgConn) pMsgConn->DelRef(); pMsgConn = pConn; pMsgConn->AddRef(); } if (!pDataConn) SetDataConn(pConn); }