50 lines
1020 B
C#
50 lines
1020 B
C#
|
|
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}";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|