using System;
using System.Net.Sockets;
namespace TcpServer
{
///
/// Internal class to join the TCP client and buffer together
/// for easy management in the server
///
public class TcpClientState
{
///
/// Constructor for a new Client
///
/// The TCP client
/// The byte array buffer
/// The protocol filter
public TcpClientState(TcpClient tcpClient, byte[] buffer, ProtoFilter prot)
{
if (tcpClient == null)
throw new ArgumentNullException("tcpClient");
if (buffer == null)
throw new ArgumentNullException("buffer");
if (prot == null)
throw new ArgumentNullException("prot");
this.TcpClient = tcpClient;
this.Buffer = buffer;
this.Prot = prot;
// this.NetworkStream = tcpClient.GetStream ();
}
///
/// Gets the TCP Client
///
public TcpClient TcpClient { get; private set; }
///
/// Gets the Buffer.
///
public byte[] Buffer { get; private set; }
public ProtoFilter Prot { get; private set; }
///
/// Gets the network stream
///
public NetworkStream NetworkStream
{
get
{
return TcpClient.GetStream();
}
}
}
}