using System.Net; namespace Server.Networking; public interface IConnection : IAsyncDisposable { Guid Id { get; } EndPoint? RemoteEndPoint { get; } DateTime LastSeenUtc { get; } // Send a raw payload (already framed/serialized by caller) ValueTask SendAsync(ReadOnlyMemory payload, CancellationToken ct = default); // Receive next **complete** message (length-prefixed by transport adapter) ValueTask?> ReceiveAsync(CancellationToken ct = default); // For heartbeats/metrics bool IsAlive { get; } // Close with reason ValueTask CloseAsync(string reason, CancellationToken ct = default); }