wcs_server_s7_baoying/WcsMain/Tcp/Entity/TcpServeConnectionData.cs

50 lines
1020 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Net.Sockets;
using WcsMain.DataBase.TableEntity;
using WcsMain.Enum.General;
namespace WcsMain.Tcp.Entity;
/// <summary>
/// 用于存储 TCP 连接的服务端信息
/// </summary>
public class TcpServeConnectionData
{
/// <summary>
/// 基础信息
/// </summary>
public AppTcp? TcpServe { get; set; }
/// <summary>
/// 别称
/// </summary>
public string? DisplayName { get; set; }
/// <summary>
/// Tcp客户端连接
/// </summary>
public TcpClient? TcpClient { get; set; }
/// <summary>
/// 是否连接
/// </summary>
/// <remarks>
/// 刚创建时是null断开是false连接正常是true
/// </remarks>
public TrueFalseEnum? IsConnected { get; set; }
/// <summary>
/// 上次接收消息的事件
/// </summary>
public DateTime RecvMsgTime { get; set; } = DateTime.Now;
public override string ToString()
{
return $"{TcpServe?.TcpIp}:{TcpServe?.TcpPort}";
}
}