System.Net.ServerSentEvents 9.0.0-rc.2.24473.5
About
System.Net.ServerSentEvents provides the SseParser type, which exposes factory methods for creating parsers for the events in a stream of server-sent events (SSE).
Key Features
- Parser for server-sent events (SSE)
How to Use
Asynchronously parsing event contents as strings
using HttpClient client = new();
using Stream stream = await client.GetStreamAsync("https://localhost:12345/sse");
await foreach (SseItem<string> item in SseParser.Create(stream).EnumerateAsync())
{
Console.WriteLine(item.Data);
}
Synchronously parsing event contents as JSON
MemoryStream stream = new(data);
foreach (SseItem<Book> item in SseParser.Create(stream, (eventType, bytes) => JsonSerializer.Deserialize<Book>(bytes)).Enumerate())
{
Console.WriteLine(item.Data.Author);
}
Main Types
The main types provided by this library are:
System.Net.ServerSentEvents.SseParserSystem.Net.ServerSentEvents.SseParser<T>System.Net.ServerSentEvents.SseItem<T>
Feedback & Contributing
System.Net.ServerSentEvents is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
Showing the top 20 packages that depend on System.Net.ServerSentEvents.
| Packages | Downloads |
|---|---|
|
OpenAI
The official .NET library for the OpenAI service API.
|
1 |
https://go.microsoft.com/fwlink/?LinkID=799421
.NET Framework 4.6.2
- Microsoft.Bcl.AsyncInterfaces (>= 9.0.0-rc.2.24473.5)
- System.Memory (>= 4.5.5)
- System.Threading.Tasks.Extensions (>= 4.5.4)
.NET 8.0
- No dependencies.
.NET 9.0
- No dependencies.
.NET Standard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 9.0.0-rc.2.24473.5)
- System.Memory (>= 4.5.5)
- System.Threading.Tasks.Extensions (>= 4.5.4)
| Version | Downloads | Last updated |
|---|---|---|
| 10.0.1 | 0 | 09.12.2025 |
| 10.0.0 | 0 | 11.11.2025 |
| 10.0.0-rc.2.25502.107 | 1 | 08.11.2025 |
| 10.0.0-rc.1.25451.107 | 1 | 08.11.2025 |
| 10.0.0-preview.7.25380.108 | 1 | 08.11.2025 |
| 10.0.0-preview.6.25358.103 | 1 | 08.11.2025 |
| 10.0.0-preview.5.25277.114 | 1 | 08.11.2025 |
| 10.0.0-preview.4.25258.110 | 1 | 08.11.2025 |
| 10.0.0-preview.3.25171.5 | 1 | 08.11.2025 |
| 10.0.0-preview.2.25163.2 | 1 | 08.11.2025 |
| 10.0.0-preview.1.25080.5 | 1 | 08.11.2025 |
| 9.0.11 | 0 | 11.11.2025 |
| 9.0.10 | 1 | 08.11.2025 |
| 9.0.9 | 1 | 08.11.2025 |
| 9.0.8 | 1 | 08.11.2025 |
| 9.0.7 | 1 | 08.11.2025 |
| 9.0.6 | 1 | 08.11.2025 |
| 9.0.5 | 1 | 08.11.2025 |
| 9.0.4 | 1 | 08.11.2025 |
| 9.0.3 | 1 | 08.11.2025 |
| 9.0.2 | 1 | 08.11.2025 |
| 9.0.1 | 1 | 08.11.2025 |
| 9.0.0 | 1 | 08.11.2025 |
| 9.0.0-rc.2.24473.5 | 1 | 08.11.2025 |
| 9.0.0-rc.1.24431.7 | 1 | 08.11.2025 |
| 9.0.0-preview.7.24405.7 | 1 | 08.11.2025 |
| 9.0.0-preview.6.24327.7 | 1 | 08.11.2025 |