mirror of
https://github.com/yawaflua/WebSockets.git
synced 2026-02-04 22:14:11 +02:00
adds comments, OOP incapsulation and publish package to nuget
This commit is contained in:
24
yawaflua.WebSockets/Models/Interfaces/IWebSocket.cs
Normal file
24
yawaflua.WebSockets/Models/Interfaces/IWebSocket.cs
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user