Class HttpWebSocket
Provides an persistent bi-directional socket between the client and the HTTP server.
public sealed class HttpWebSocket : IDisposable
- Inheritance
-
HttpWebSocket
- Implements
- Inherited Members
Properties
- HttpRequest
Gets the HttpRequest object which created this Web Socket instance.
- Identifier
Gets an unique identifier label to this Web Socket connection, useful for finding this connection's reference later.
- IsClosed
Gets an boolean indicating if this Web Socket connection is closed.
- PingPolicy
Gets the HttpStreamPingPolicy for this HTTP web socket connection.
Methods
- CloseAsync(CancellationToken)
Closes the WebSocket connection asynchronously.
- ReceiveMessageAsync()
Receives a message from the WebSocket endpoint asynchronously with a default timeout of 30 seconds.
- ReceiveMessageAsync(CancellationToken)
Receives a message from the WebSocket endpoint asynchronously.
- ReceiveMessageAsync(TimeSpan)
Receives a message from the WebSocket endpoint asynchronously with a specified timeout.
- SendAsync(ReadOnlyMemory<byte>, CancellationToken)
Sends an asynchronous binary message to the WebSocket endpoint.
- SendAsync(string, CancellationToken)
Sends an asynchronous text message to the WebSocket endpoint.