System.Net.ServerSentEvents 9.0.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 |
|---|---|
|
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/704f7cb1d2cea33afb00c2097731216f121c2c73
|
1 |
|
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/b96167fbfe8bd45d94e4dcda42c7d09eb5745459
|
1 |
|
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/b225d30209cf027c80b741d04efe1c54f2431b3c
|
0 |
|
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/4442a188f9200a57635373dcd640893c0e8dcc78
|
0 |
|
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers
This package was built from the source code at https://github.com/dotnet/dotnet/tree/c22dcd0c7a78d095a94d20e59ec0271b9924c82c
|
0 |
|
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/5bae930797f60d2d04f3b1df6a33eaca85fc5f28
|
0 |
|
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers
This package was built from the source code at https://github.com/dotnet/dotnet/tree/b0f34d51fccc69fd334253924abd8d6853fad7aa
|
0 |
|
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers
This package was built from the source code at https://github.com/dotnet/dotnet/tree/89c8f6a112d37d2ea8b77821e56d170a1bccdc5a
|
0 |
|
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/c70204ae3c91d2b48fa6d9b92b62265f368421b4
|
0 |
https://go.microsoft.com/fwlink/?LinkID=799421
.NET Framework 4.6.2
- Microsoft.Bcl.AsyncInterfaces (>= 9.0.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.5)
- System.Memory (>= 4.5.5)
- System.Threading.Tasks.Extensions (>= 4.5.4)
| Version | Downloads | Last updated |
|---|---|---|
| 10.0.1 | 0 | 12/09/2025 |
| 10.0.0 | 0 | 12/09/2025 |
| 10.0.0-rc.2.25502.107 | 0 | 10/14/2025 |
| 10.0.0-rc.1.25451.107 | 0 | 09/09/2025 |
| 10.0.0-preview.7.25380.108 | 0 | 08/12/2025 |
| 10.0.0-preview.6.25358.103 | 0 | 07/15/2025 |
| 10.0.0-preview.5.25277.114 | 0 | 06/06/2025 |
| 10.0.0-preview.4.25258.110 | 0 | 05/12/2025 |
| 10.0.0-preview.3.25171.5 | 0 | 04/10/2025 |
| 10.0.0-preview.2.25163.2 | 0 | 03/18/2025 |
| 10.0.0-preview.1.25080.5 | 0 | 02/25/2025 |
| 9.0.11 | 0 | 12/09/2025 |
| 9.0.10 | 0 | 12/09/2025 |
| 9.0.9 | 0 | 12/09/2025 |
| 9.0.8 | 0 | 12/09/2025 |
| 9.0.7 | 0 | 12/09/2025 |
| 9.0.6 | 0 | 12/09/2025 |
| 9.0.5 | 0 | 12/09/2025 |
| 9.0.4 | 0 | 12/09/2025 |
| 9.0.3 | 0 | 12/09/2025 |
| 9.0.2 | 0 | 02/11/2025 |
| 9.0.1 | 0 | 01/14/2025 |
| 9.0.0 | 0 | 11/12/2024 |
| 9.0.0-rc.2.24473.5 | 0 | 10/08/2024 |
| 9.0.0-rc.1.24431.7 | 0 | 09/10/2024 |
| 9.0.0-preview.7.24405.7 | 0 | 08/13/2024 |
| 9.0.0-preview.6.24327.7 | 0 | 07/09/2024 |