Class HttpListenerWebSocketContext

Namespace
Cratis.Arc.Http
Assembly
Cratis.Arc.Core.dll

Implementation of IWebSocketContext for HttpListener.

public class HttpListenerWebSocketContext : IWebSocketContext
Inheritance
HttpListenerWebSocketContext
Implements
Inherited Members
Extension Methods

Constructors

HttpListenerWebSocketContext(HttpListenerContext)

Implementation of IWebSocketContext for HttpListener.

public HttpListenerWebSocketContext(HttpListenerContext listenerContext)

Parameters

listenerContext HttpListenerContext

The HttpListenerContext.

Properties

IsWebSocketRequest

Gets a value indicating whether the request is a WebSocket request.

public bool IsWebSocketRequest { get; }

Property Value

bool

Methods

AcceptWebSocket(CancellationToken)

Accepts the WebSocket connection.

public Task<IWebSocket> AcceptWebSocket(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

Task<IWebSocket>

A IWebSocket for communication.