using System; using System.Collections.Generic; using System.ComponentModel; using System.Net.Sockets; using System.Text; using SocketHelper.TClass; namespace SocketHelper.IModels { /// /// 此类在旧版本AxTcpServer组件中中使用 /// 客户端类 /// public class ClientModel { private byte[] _bufferBackup = null;//备份缓冲区;主要是缓冲区有时候需要增大或缩小的时候用到; /// /// 备份缓冲区;主要是缓冲区有时候需要增大或缩小的时候用到; /// internal byte[] BufferBackup { get { return _bufferBackup; } set { _bufferBackup = value; } } /// /// 接受的数据缓存 /// public string RecevidMsg = ""; /// /// 缓存数据 /// public List RecevidBuffer = new List(); /// /// PC嵌套字 /// public Socket ClientSocket; /// /// 客户端类型1 /// public ClientType Clienttype = ClientType.None; /// /// Socket类型(网页版或者PC版) /// public ClientStyle ClientStyle = ClientStyle.PcSocket; /// /// 客户端编号 /// public int Id = -1; /// /// 若是小车类型,则该标示表示车辆编号,若是信号机类型,则该标示表示信号机编号,其他则不使用该类型 /// public string ClientNo = ""; /// /// 如果是小车类型,则该项用于存储车辆运动状态,默认:运动 /// public VehicleMotionState VehicleMotionState = VehicleMotionState.Running; /// /// 判断在停车位上的状态 /// public SitState SitState = SitState.None; public LedState[] SingleState = new LedState[0]; public LedState[] SidewalkState = new LedState[0]; /// /// 若是小车类型,则该标示表示小车单前的RFID卡号 /// public string ClientRfidNo = ""; /// /// 若是小车类型,则该标示表示小车单前的车道号 /// public string ClientLaneNo = ""; /// /// 若是PC客户端类型,则下面两个表示表示用户登陆账号和密码 /// public string Username = ""; public string Password = ""; //存储PC客户端当前需要订阅的车辆 public List CarNo { get; set; } /// /// 如果是闸机,升降杆客户端,(用于存储各个控制端的状态) /// public byte[] MotorClientState = new byte[32]; /// /// 是否登陆 /// public bool IsLogin { get; set; } /// /// 是否授权 /// public bool IsAuthorization { get; set; } /// /// 是否在线 /// public bool IsOnline = true; /// /// 心跳包字符串【如果为空则不发送心跳包】 /// public string Heartbeat = ""; public string OrderType = ""; /// /// 承载客户端Socket的网络流 /// public NetworkStream NetworkStream { get; set; } /// /// 发生异常时不为null. /// public Exception Exception { get; set; } /// /// 接收缓冲区 /// public byte[] RecBuffer =new byte[1024]; /// /// 发送缓冲区 /// public byte[] SendBuffer { get; set; } /// /// 异步接收后包的大小 /// public int Offset { get; set; } } }