示例#1
0
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);
}
示例#2
0
void C4Network2Client::SetDataConn(C4Network2IOConnection *pConn) {
  // security
  if (pConn != pDataConn) {
    if (pDataConn) pDataConn->DelRef();
    pDataConn = pConn;
    pDataConn->AddRef();
  }
  if (!pMsgConn) SetMsgConn(pConn);
}