This commit is contained in:
EonaCat authored and Jeroen Saey committed 2026-11-04 07:53:40 +01:00
1 parent 2c5b69bf2c
commit 22dee59f47
132 files changed
+19653 -7192

No files matched your search

@@ -0,0 +1,37 @@
using System.Net;
using System.Net.Quic;
using System.Runtime.Versioning;
namespace EonaCat.Connections.Quic
{
[SupportedOSPlatform("windows")]
[SupportedOSPlatform("linux")]
[SupportedOSPlatform("macos")]
[RequiresPreviewFeatures]
public class QuicClientConnection
{
public string Id { get; set; } = string.Empty;
public QuicConnection? Connection { get; set; }
public QuicStream? Stream { get; set; }
public IPEndPoint? RemoteEndPoint { get; set; }
public SemaphoreSlim WriteLock { get; } = new(1, 1);
public DateTime ConnectedAt { get; set; }
public DateTime LastActive { get; set; }
public DateTime LastDataSent { get; set; }
public DateTime LastDataReceived { get; set; }
public long BytesSent { get; set; }
public long BytesReceived { get; set; }
public long MessagesSent { get; set; }
public long MessagesReceived { get; set; }
private string? _nickname;
public string Nickname
{
get => string.IsNullOrWhiteSpace(_nickname) ? Id : _nickname;
set => _nickname = string.IsNullOrWhiteSpace(value) ? Id : value;
}
public bool HasNickname => !string.IsNullOrWhiteSpace(_nickname) && _nickname != Id;
}
}