adds comments, OOP incapsulation and publish package to nuget

This commit is contained in:
Dmitri Shimanski
2025-03-29 02:54:54 +03:00
parent 2ba9667a01
commit 1b1eb17bee
11 changed files with 103 additions and 19 deletions

View File

@@ -0,0 +1,24 @@
using System.Net.WebSockets;
namespace yawaflua.WebSockets.Models.Interfaces;
public interface IWebSocket : IDisposable
{
WebSocketState State { get; }
WebSocketCloseStatus? CloseStatus { get; }
string? SubProtocol { get; }
string? CloseStatusDescription { get; }
string? Message { get; }
WebSocketMessageType? MessageType { get; }
IWebSocketClient Client { get; }
Task SendAsync(string message,
WebSocketMessageType messageType = WebSocketMessageType.Text,
CancellationToken cancellationToken = default);
Task CloseAsync(WebSocketCloseStatus closeStatus = WebSocketCloseStatus.NormalClosure,
string? reason = null,
CancellationToken cancellationToken = default);
void Abort();
}