protected void AddCreator(CreatorManage pCreator)
 {
     if (!this.Disposed)
     {
         lock (this.arrCreators)
         {
             this.arrCreators.Add(pCreator);
         }
     }
 }
        public CreatorManage[] GetSocketCreators()
        {
            CreatorManage[] pCreatorItems = null;

            if (!this.Disposed)
            {
                lock (this.arrCreators)
                {
                    pCreatorItems = new CreatorManage[this.arrCreators.Count];
                    this.arrCreators.CopyTo(pCreatorItems, 0);
                }
            }

            return(pCreatorItems);
        }
        protected void RemoveCreator(CreatorManage pCreator)
        {
            if (!this.Disposed)
            {
                lock (this.arrCreators)
                {
                    this.arrCreators.Remove(pCreator);

                    if (this.arrCreators.Count <= 0)
                    {
                        pCreatorsResetEvent.Set();
                    }
                }
            }
        }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="pSocket">Socket类</param>
        /// <param name="pManagement">Socket管理类</param>
        /// <param name="eEncryptType">加密方式</param>
        /// <param name="eCompressionType">压缩方式</param>
        public ConnectionManage(Socket pSocket, CreatorManage pCreator, ServiceManage pService)
        {
            //赋值
            this._pSocket  = pSocket;
            this._pCreator = pCreator;
            this._pService = pService;

            //初始化变量
            //--连接状态
            this.bConnectActive = false;
            this.pConnectActive = new object();
            //--接收状态
            this.iReciveCount = 0;
            this.bReciveState = true;
            this.pReciveLock  = new object();
            //--发送状态
            this.bSendState = false;
            this.pSendItems = new Queue <SocketBuffer>();

            //创建会话ID
            this.strSession = Guid.NewGuid().ToString().ToUpper().Replace("-", "");
            //用户活动时间
            this.pActiveTime = DateTime.Now;
        }
 internal ClientConnect(Socket pSocket, CreatorManage pCreator, ServiceManage pService)
     : base(pSocket, pCreator, pService)
 {
 }