SseParser.Create Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Create(Stream) |
Creates a parser for parsing a |
Create<T>(Stream, SseItemParser<T>) |
Creates a parser for parsing a |
Create(Stream)
- Source:
- SseParser.cs
- Source:
- SseParser.cs
Creates a parser for parsing a sseStream
of server-sent events into a sequence of SseItem<T> values.
public:
static System::Net::ServerSentEvents::SseParser<System::String ^> ^ Create(System::IO::Stream ^ sseStream);
public static System.Net.ServerSentEvents.SseParser<string> Create (System.IO.Stream sseStream);
static member Create : System.IO.Stream -> System.Net.ServerSentEvents.SseParser<string>
Public Shared Function Create (sseStream As Stream) As SseParser(Of String)
Parameters
- sseStream
- Stream
The stream containing the data to parse.
Returns
The enumerable of strings, which may be enumerated synchronously or asynchronously. The strings are decoded from the UTF8-encoded bytes of the payload of each event.
Exceptions
sseStream
is null.
Remarks
This overload has behavior equivalent to calling Create<T>(Stream, SseItemParser<T>) with a delegate that decodes the data of each event using UTF8's GetString method.
Applies to
Create<T>(Stream, SseItemParser<T>)
- Source:
- SseParser.cs
- Source:
- SseParser.cs
Creates a parser for parsing a sseStream
of server-sent events into a sequence of SseItem<T> values.
public:
generic <typename T>
static System::Net::ServerSentEvents::SseParser<T> ^ Create(System::IO::Stream ^ sseStream, System::Net::ServerSentEvents::SseItemParser<T> ^ itemParser);
public static System.Net.ServerSentEvents.SseParser<T> Create<T> (System.IO.Stream sseStream, System.Net.ServerSentEvents.SseItemParser<T> itemParser);
static member Create : System.IO.Stream * System.Net.ServerSentEvents.SseItemParser<'T> -> System.Net.ServerSentEvents.SseParser<'T>
Public Shared Function Create(Of T) (sseStream As Stream, itemParser As SseItemParser(Of T)) As SseParser(Of T)
Type Parameters
- T
Specifies the type of data in each event.
Parameters
- sseStream
- Stream
The stream containing the data to parse.
- itemParser
- SseItemParser<T>
The parser to use to transform each payload of bytes into a data element.
Returns
The enumerable, which may be enumerated synchronously or asynchronously.
Exceptions
itemParser
is null.