using System.Net.Sockets; namespace JiLinApp.Docking.VibrateAlarm; public class TcpClientState { /// /// Constructor for a new Client /// /// The TCP client /// The byte array buffer public TcpClientState(TcpClient tcpClient, byte[] buffer) { if (tcpClient == null) throw new ArgumentNullException("tcpClient"); if (buffer == null) throw new ArgumentNullException("buffer"); TcpClient = tcpClient; Buffer = buffer; temp = string.Empty; } /// /// Gets the TCP Client /// public TcpClient TcpClient { get; private set; } /// /// Gets the Buffer. /// public byte[] Buffer { get; private set; } /// /// TCP接收到但未处理的数据 /// public string temp { get; set; } /// /// Gets the network stream /// public NetworkStream NetworkStream { get { return TcpClient.GetStream(); } } }