34 lines
813 B
C#
34 lines
813 B
C#
using System.Net;
|
|
using System.Net.Quic;
|
|
using System.Net.Security;
|
|
using DTLib.Extensions;
|
|
using DTLib.Logging;
|
|
|
|
namespace Meum.Client;
|
|
|
|
public class ServerConnection : IAsyncDisposable
|
|
{
|
|
private readonly QuicConnection _quicConnection;
|
|
private readonly ILogger _logger;
|
|
|
|
public DnsEndPoint ServerEndPoint { get; }
|
|
|
|
|
|
public ServerConnection(QuicConnection quicConnection, DnsEndPoint serverEndPoint, ILogger logger)
|
|
{
|
|
ServerEndPoint = serverEndPoint;
|
|
_quicConnection = quicConnection;
|
|
_logger = logger;
|
|
}
|
|
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return _quicConnection.RemoteEndPoint.GetHashCode();
|
|
}
|
|
|
|
public async ValueTask DisposeAsync()
|
|
{
|
|
await _quicConnection.DisposeAsync();
|
|
}
|
|
} |