using System; using System.Collections.Generic; using System.Linq; using System.Net.Sockets; using System.Text; using System.Threading; using System.Threading.Tasks; namespace MECF.Framework.Common.Net { public class NetStateObject : IDisposable { /// /// Socket对象 /// public Socket Socket { get; set; } /// /// 操作完成的信号 /// public AutoResetEvent AutoResetEvent { get; set; } /// /// 数据长度 /// public int DataLength { get; set; } /// /// 缓存数据 /// public byte[] Buffer { get; set; } /// /// 是否发生错误 /// public bool IsError { get; set; } /// /// 错误代码 /// public int ErrorCode { get; set; } /// /// 错误信息 /// public string ErrorMessage { get; set; } /// /// 释放资源 /// public void Dispose() { DataLength = 0; Buffer = null; } } }