System.Net.ServerSentEvents 11.0.0-preview.7.26381.103

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.SseParser
  • System.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
ModelContextProtocol
.NET SDK for the Model Context Protocol (MCP)
5
ModelContextProtocol
.NET SDK for the Model Context Protocol (MCP)
6
ModelContextProtocol.Core
Core .NET SDK for the Model Context Protocol (MCP)
4
ModelContextProtocol.Core
Core .NET SDK for the Model Context Protocol (MCP)
5
Refit
Type-safe REST API clients for .NET, generated from annotated interfaces with build-time source generation, direct request construction, System.Text.Json defaults, and support for trimming and AOT.
13
Refit
Type-safe REST API clients for .NET, generated from annotated interfaces with build-time source generation, direct request construction, System.Text.Json defaults, and support for trimming and AOT.
14
Refit
Type-safe REST API clients for .NET, generated from annotated interfaces with build-time source generation, direct request construction, System.Text.Json defaults, and support for trimming and AOT.
15
Refit
Type-safe REST API clients for .NET, generated from annotated interfaces with build-time source generation, direct request construction, System.Text.Json defaults, and support for trimming and AOT.
16
Refit
Type-safe REST API clients for .NET, generated from annotated interfaces with build-time source generation, direct request construction, System.Text.Json defaults, and support for trimming and AOT.
18
System.ClientModel
Contains building blocks for clients that call cloud services.
12

https://go.microsoft.com/fwlink/?LinkID=799421

.NET 10.0

  • No dependencies.

.NET 11.0

  • No dependencies.

.NET Framework 4.6.2

.NET Standard 2.0

Version Downloads Last updated
11.0.0-preview.7.26381.103 8 08/15/2026
11.0.0-preview.6.26359.118 20 07/15/2026
11.0.0-preview.5.26302.115 16 07/15/2026
11.0.0-preview.4.26230.115 18 07/15/2026
11.0.0-preview.3.26207.106 12 07/15/2026
11.0.0-preview.2.26159.112 15 07/15/2026
11.0.0-preview.1.26104.118 17 07/15/2026
10.0.11 7 08/15/2026
10.0.10 14 07/15/2026
10.0.9 18 07/15/2026
10.0.8 17 07/15/2026
10.0.7 20 07/15/2026
10.0.6 18 07/15/2026
10.0.5 20 07/15/2026
10.0.4 18 07/15/2026
10.0.3 15 07/15/2026
10.0.2 17 07/15/2026
10.0.1 17 07/15/2026
10.0.0 16 07/15/2026
10.0.0-rc.2.25502.107 13 07/15/2026
10.0.0-rc.1.25451.107 19 07/15/2026
10.0.0-preview.7.25380.108 13 07/15/2026
10.0.0-preview.6.25358.103 16 07/15/2026
10.0.0-preview.5.25277.114 15 07/15/2026
10.0.0-preview.4.25258.110 18 07/15/2026
10.0.0-preview.3.25171.5 15 07/15/2026
10.0.0-preview.2.25163.2 15 07/15/2026
10.0.0-preview.1.25080.5 18 07/15/2026
9.0.19 7 08/15/2026
9.0.18 15 07/15/2026
9.0.17 19 07/15/2026
9.0.16 18 07/15/2026
9.0.15 16 07/15/2026
9.0.14 16 07/15/2026
9.0.13 19 07/15/2026
9.0.12 14 07/15/2026
9.0.11 16 07/15/2026
9.0.10 18 07/15/2026
9.0.9 18 07/15/2026
9.0.8 17 07/15/2026
9.0.7 17 07/15/2026
9.0.6 13 07/15/2026
9.0.5 20 07/15/2026
9.0.4 18 07/15/2026
9.0.3 18 07/15/2026
9.0.2 17 07/15/2026
9.0.1 14 07/15/2026
9.0.0 15 07/15/2026
9.0.0-rc.2.24473.5 15 07/15/2026
9.0.0-rc.1.24431.7 15 07/15/2026
9.0.0-preview.7.24405.7 17 07/15/2026
9.0.0-preview.6.24327.7 15 07/15/2026