Class HttpRequestEventSource
An HttpRequestEventSource instance opens a persistent connection to the request, which sends events in text/event-stream format.
public sealed class HttpRequestEventSource : IDisposable
- Inheritance
-
HttpRequestEventSource
- Implements
- Inherited Members
Properties
- 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
- 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()
Flushes and 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(CancellationToken)
Asynchronously waits for the event source to fail or be canceled.
- WaitForFailAsync(TimeSpan)
Asynchronously waits for the event source to fail or reach the specified idle tolerance.
- WithPing(Action<HttpStreamPingPolicy>)
Configures the ping policy for this instance of HTTP Event Source.
English
Русский
Português
Español
Deutsch
中文 (简体)
日本語