Class
HttpRequestEventSource
An HttpRequestEventSource instance opens a persistent connection to the request, which sends events in text/event-stream format.
public sealed class HttpRequestEventSource : IDisposableInheritance #
object ← HttpRequestEventSource
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 Event Source instance. |
| Identifier | Gets an unique identifier label to this EventStream connection, useful for finding this connection’s reference later. |
| IsActive | Gets an boolean indicating if this connection is open and this instance can send messages. |
| PingPolicy | Gets the HttpStreamPingPolicy for this HTTP event source connection. |
| SentContentLength | Gets an integer indicating the total bytes sent by this instance to the client. |
Methods #
| Name | Description |
|---|---|
| AppendHeader(string, string) | Sends an header to the streaming context. |
| Cancel() | Cancels the sending queue from sending pending messages and clears the queue. |
| Close() | Closes the event listener and it’s connection. |
| CloseAsync() | Asynchronously closes the event listener and its connection. |
| Dispose() | Releases the used resources of this class instance. |
| KeepAlive() | Keeps the event source alive indefinitely. |
| Send(string?, string) | Sends an event to the client over the HTTP connection. |
| SendAsync(string?, string) | Asynchronously sends an event to the client over the HTTP connection. |
| WaitForFail(TimeSpan) | Waits for the event source to fail or reach the specified idle tolerance. |
| WaitForFailAsync(TimeSpan) | Asynchronously waits for the event source to fail or reach the specified idle tolerance. |
| WaitForFailAsync(CancellationToken) | Asynchronously waits for the event source to fail or be canceled. |
| WithPing(Action<HttpStreamPingPolicy>) | Configures the ping policy for this instance of HTTP Event Source. |