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
listenerContextHttpListenerContextThe HttpListenerContext.
Properties
IsWebSocketRequest
Gets a value indicating whether the request is a WebSocket request.
public bool IsWebSocketRequest { get; }
Property Value
Methods
AcceptWebSocket(CancellationToken)
Accepts the WebSocket connection.
public Task<IWebSocket> AcceptWebSocket(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<IWebSocket>
A IWebSocket for communication.