Class
HttpWebSocket
Provides an persistent bi-directional socket between the client and the HTTP server.
public sealed class HttpWebSocket : IDisposableInheritance #
Implements #
Inherited Members #
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Properties #
| Name | Description |
|---|---|
| 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. |
| State | Gets or sets an object linked with this WebSocket session. |
Methods #
| Name | Description |
|---|---|
| CloseAsync(CancellationToken) | Closes the WebSocket connection asynchronously. |
| Dispose() | |
| ReceiveMessageAsync(CancellationToken) | Receives a message from the WebSocket endpoint asynchronously. |
| ReceiveMessageAsync(TimeSpan) | Receives a message from the WebSocket endpoint asynchronously with a specified timeout. |
| ReceiveMessageAsync() | Receives a message from the WebSocket endpoint asynchronously with a default timeout of 30 seconds. |
| SendAsync(string, CancellationToken) | Sends an asynchronous text message to the WebSocket endpoint. |
| SendAsync(ReadOnlyMemory<byte>, CancellationToken) | Sends an asynchronous binary message to the WebSocket endpoint. |