SocketOpt.cs 1.23 KB
using System.Net.Sockets;

namespace RCS.Model.Comm
{
    /// <summary>
    /// Socket处理实体
    /// </summary>
    public class SocketOpt
    {
        /// <summary>
        /// 接收的报文数据
        /// </summary>
        public byte[] RecData { get; set; }

        /// <summary>
        /// 发送的报文数据
        /// </summary>
        public byte[]? SendData { get; set; }

        /// <summary>
        /// 客户端对象
        /// </summary>
        public Socket ClientSocket { get; set; }

        /// <summary>
        /// 客户端的IP地址
        /// </summary>
        public string ClientIp { get; set; }

        /// <summary>
        /// 处理时间
        /// </summary>
        public int DealTime { get; set; }

        /// <summary>
        /// 设备编号
        /// </summary>
        public string? EquipmentNo;
        /// <summary>
        /// Socket处理实体
        /// </summary>
        /// <param name="SClient">客户端对象</param>
        /// <param name="Rec">报文信息</param>
        public SocketOpt(Socket socket, string clientIp, byte[] receive)
        {
            ClientSocket = socket;
            ClientIp = clientIp;
            RecData = receive;
        }
    }
}