31 lines
728 B
C#
31 lines
728 B
C#
|
using System.Net.Sockets;
|
|||
|
using System.Net;
|
|||
|
|
|||
|
namespace Uwaa.HTTP;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Information about a client which connected to a <see cref="HttpServer"/>.
|
|||
|
/// </summary>
|
|||
|
public class HttpClientInfo
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// The TCP client sending this request.
|
|||
|
/// </summary>
|
|||
|
public readonly TcpClient TcpClient;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// The IP address and port of the requester.
|
|||
|
/// </summary>
|
|||
|
public readonly IPEndPoint Endpoint;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// If true, the request is connected.
|
|||
|
/// </summary>
|
|||
|
public bool Connected => TcpClient.Connected;
|
|||
|
|
|||
|
internal HttpClientInfo(TcpClient client, IPEndPoint endpoint)
|
|||
|
{
|
|||
|
TcpClient = client;
|
|||
|
Endpoint = endpoint;
|
|||
|
}
|
|||
|
}
|