Client Web Socket implementation (#46)

This commit is contained in:
2023-05-14 22:46:38 +02:00
committed by GitHub
parent a25f2e5acb
commit de08c0e3b0
13 changed files with 234 additions and 107 deletions
@@ -0,0 +1,31 @@
using System.Threading.Tasks;
using System.Threading;
namespace System.Net.WebSockets;
public interface IClientWebSocket<TScope>
{
WebSocketCloseStatus? CloseStatus { get; }
string CloseStatusDescription { get; }
ClientWebSocketOptions Options { get; }
WebSocketState State { get; }
string SubProtocol { get; }
void Abort();
Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken);
Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken);
Task ConnectAsync(Uri uri, CancellationToken cancellationToken);
void Dispose();
Task<WebSocketReceiveResult> ReceiveAsync(ArraySegment<byte> buffer, CancellationToken cancellationToken);
Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken);
}