Sisk

Class

HttpWebSocket

Namespace
Sisk.Core.Http.Streams
Assembly
Sisk.Core.dll

Provides an persistent bi-directional socket between the client and the HTTP server.

C#
public sealed class HttpWebSocket : IDisposable

Inheritance #

object ← HttpWebSocket

Implements #

IDisposable

Inherited Members #

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Properties #

NameDescription
HttpRequestGets the HttpRequest object which created this Web Socket instance.
IdentifierGets an unique identifier label to this Web Socket connection, useful for finding this connection’s reference later.
IsClosedGets an boolean indicating if this Web Socket connection is closed.
PingPolicyGets the HttpStreamPingPolicy for this HTTP web socket connection.
StateGets or sets an object linked with this WebSocket session.

Methods #

NameDescription
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.

Type to search the documentation and the API reference.