System.Net.ServerSentEvents 11.0.0-preview.6.26359.118

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.Core
Core .NET SDK for the Model Context Protocol (MCP)
32
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
31
ModelContextProtocol.Core
Core .NET SDK for the Model Context Protocol (MCP)
30
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/fad253f51b461736dfd3cd9c15977bb7493becef
29
ModelContextProtocol.Core
Core .NET SDK for the Model Context Protocol (MCP)
29
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/a8b33e7593686eaee701cd124daaabff2311634f
29
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/44525024595742ebe09023abe709df51de65009b
28
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/87bc0b04e21d786669142109a5128c95618b75ed
28
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/17d11de66cf75b962995c81dd1235fae9aa5ece0
28
ModelContextProtocol
.NET SDK for the Model Context Protocol (MCP)
28
ModelContextProtocol.Core
Core .NET SDK for the Model Context Protocol (MCP)
28
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
27
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/2db1f5ee2bdda2e8d873769325fabede32e420e0
27
ModelContextProtocol
.NET SDK for the Model Context Protocol (MCP)
27
ModelContextProtocol.Core
Core .NET SDK for the Model Context Protocol (MCP)
27

.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.6.26359.118 1 07/19/2026
11.0.0-preview.5.26302.115 11 06/14/2026
11.0.0-preview.4.26230.115 18 05/15/2026
11.0.0-preview.3.26207.106 22 04/16/2026
11.0.0-preview.2.26159.112 25 03/13/2026
11.0.0-preview.1.26104.118 30 02/13/2026
10.0.10 2 07/20/2026
10.0.9 12 06/15/2026
10.0.8 22 05/16/2026
10.0.7 16 04/24/2026
10.0.6 22 04/16/2026
10.0.5 22 03/13/2026
10.0.4 22 03/13/2026
10.0.3 26 02/13/2026
10.0.2 27 01/18/2026
10.0.1 31 12/11/2025
10.0.0 21 12/13/2025
10.0.0-rc.2.25502.107 23 12/13/2025
10.0.0-rc.1.25451.107 28 12/13/2025
10.0.0-preview.7.25380.108 19 12/13/2025
10.0.0-preview.6.25358.103 24 12/13/2025
10.0.0-preview.5.25277.114 23 12/13/2025
10.0.0-preview.4.25258.110 27 12/11/2025
10.0.0-preview.3.25171.5 18 12/13/2025
10.0.0-preview.2.25163.2 24 12/13/2025
10.0.0-preview.1.25080.5 28 12/11/2025
9.0.18 1 07/19/2026
9.0.17 13 06/15/2026
9.0.16 15 05/15/2026
9.0.15 19 04/16/2026
9.0.14 21 03/13/2026
9.0.13 32 02/13/2026
9.0.12 26 01/19/2026
9.0.11 23 12/13/2025
9.0.10 37 12/12/2025
9.0.9 30 12/13/2025
9.0.8 24 12/12/2025
9.0.7 21 12/13/2025
9.0.6 24 12/13/2025
9.0.5 22 12/09/2025
9.0.4 26 12/13/2025
9.0.3 27 12/13/2025
9.0.2 24 12/13/2025
9.0.1 29 12/13/2025
9.0.0 27 12/13/2025
9.0.0-rc.2.24473.5 28 12/12/2025
9.0.0-rc.1.24431.7 23 12/13/2025
9.0.0-preview.7.24405.7 28 12/13/2025
9.0.0-preview.6.24327.7 30 12/12/2025