/// <summary>
 /// 对象池信息
 /// </summary>
 private void OnCommand_Pools(string[] param)
 {
     NetChannelPools.ToString(true);
     UserTokenPools.ToString(true);
     IOCPClientSocket.ToString(true);
     IOCPServerSocket.ToString(true);
     SendRecvBufferPools.ToString(true);
     PacketPools.ToString(true);
     ObjectPools.ToString(true);
     CommonObjectPools.ToString(true);
 }
Ejemplo n.º 2
0
        public bool Listen(ushort port, BaseNet.OnAcceptFunction accept, BaseNet.OnReceiveFunction receive, BaseNet.OnCloseFunction close)
        {
            OnAccept  = accept;
            OnReceive = receive;
            OnClose   = close;

            m_socket            = new IOCPServerSocket();
            m_socket.OnOpen    += OnAcceptConnect;
            m_socket.OnMessage += OnMessageReveived;
            m_socket.OnClose   += OnConnectClose;
            return(m_socket.Start(port));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 对象池信息
 /// </summary>
 private void OnCommand_Pools(string[] param)
 {
     NetChannelPools.ToString(true);
     UserTokenPools.ToString(true);
     IOCPClientSocket.ToString(true);
     IOCPServerSocket.ToString(true);
     SendRecvBufferPools.ToString(true);
     PacketPools.ToString(true);
     ObjectPools.ToString(true);
     CommonObjectPools.ToString(true);
     Console.WriteLine("缓存账号数量:" + AccountCacheManager.Instance.GetCacheCount());
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 对象池信息
        /// </summary>
        private void OnCommand_Pools(string[] param)
        {
            NetChannelPools.ToString(true);
            UserTokenPools.ToString(true);
            IOCPClientSocket.ToString(true);
            IOCPServerSocket.ToString(true);
            SendRecvBufferPools.ToString(true);
            PacketPools.ToString(true);
            ObjectPools.ToString(true);
            CommonObjectPools.ToString(true);

            int unit_count     = UnitManager.Instance.GetUnitCount();
            int relation_count = RelationManager.Instance.GetMemberCount();

            Console.WriteLine("缓存玩家数量:" + unit_count + " 缓存关系数量:" + relation_count);
        }
Ejemplo n.º 5
0
 public override void Close()
 {
     if (m_socket != null)
     {
         m_socket.Close();
         m_socket = null;
     }
     //需要放m_socket.Close()后,socket关闭时,内部回调的关闭事件HanldeCloseConnect不能正常执行
     foreach (var obj in m_channels)
     {
         obj.Value.Destroy();
         NetChannelPools.Despawn(obj.Value);
     }
     m_channels.Clear();
     base.Close();
 }