using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Mesnac.Communication { public sealed class SocketAsyncEventArgsWithId : IDisposable { private string uid = "-1"; private bool state = false; private bool isAllowReceive = true; private MySocketAsyncEventArgs receiveSaea; private MySocketAsyncEventArgs sendSaea; public SocketAsyncEventArgsWithId() { this.receiveSaea = new MySocketAsyncEventArgs("Receive"); this.sendSaea = new MySocketAsyncEventArgs("Send"); } public string UID { get { return uid; } set { uid = value; receiveSaea.UID = value; sendSaea.UID = value; } } public bool State { get { return this.state; } set { this.state = value; } } /// /// 是否允许接收 /// public bool IsAllowReceive { get { return this.isAllowReceive; } set { this.isAllowReceive = value; } } public MySocketAsyncEventArgs ReceiveSAEA { get { return this.receiveSaea; } set { this.receiveSaea = value; } } public MySocketAsyncEventArgs SendSAEA { get { return this.sendSaea; } set { this.sendSaea = value; } } public void Dispose() { this.receiveSaea.Dispose(); this.sendSaea.Dispose(); } } }