Uwaa/HTTP/HttpClientInfo.cs

31 lines
728 B
C#
Raw Normal View History

2024-11-22 07:40:43 +01:00
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;
}
}