public void Clear() { this.Handshaked = false; this.Paraments.Clear(); this.Protocol = null; this.ReceivedStream.SetLength(0); this.ReceivedStream.Capacity = 0; this.SocketAsyncEventArgs.AcceptSocket = null; this.Status = SocketSessionStatus.Pending; }
/// <summary> /// 构造函数 /// </summary> /// <param name="_socketEngine">引擎对象</param> /// <param name="_socket">Socket对象</param> public SocketSession(SocketEngine _socketEngine, int _index) { this.Index = _index; this.LastOperationTime = DateTime.UtcNow; this.Paraments = new Dictionary <string, object>(); this.SocketAsyncEventArgs = new SocketAsyncEventArgs(); this.SocketAsyncEventArgs.UserToken = this; this.SocketEngine = _socketEngine; this.Status = SocketSessionStatus.Pending; }