Ejemplo n.º 1
0
        private void PostDisconnected()
        {
            NetCommand command = new NetCommand(0, LocalCMD.DISCONNECTED);

            command.WriteUInt64(m_nSessionID);
            command.MakingComplete();
            m_refCommandQueue.PushCommand(command);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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; }
            }
        }