private void PostDisconnected() { NetCommand command = new NetCommand(0, LocalCMD.DISCONNECTED); command.WriteUInt64(m_nSessionID); command.MakingComplete(); m_refCommandQueue.PushCommand(command); }
private void PostConnected(bool bIsSuccess) { NetCommand command = new NetCommand(0, LocalCMD.CONNECTED); command.WriteUInt64(m_nSessionID); command.WriteBoolean(bIsSuccess); command.MakingComplete(); m_refCommandQueue.PushCommand(command); }
private void ProcAccept() { bool bRun = true; while (bRun) { try { Socket socketClient = m_tcpListener.AcceptSocket(); if (socketClient.Connected == false) { continue; } UInt64 nSessionID = m_dlgtCreateSession(socketClient); NetCommand command = new NetCommand(0, LocalCMD.ACCEPTED); command.WriteUInt64(nSessionID); command.MakingComplete(); m_refCmdQueue.PushCommand(command); } catch { bRun = false; } } }