{
  "CHANGELOG.html": {
    "href": "CHANGELOG.html",
    "title": "Change log | LaunchDarkly EventSource for .NET",
    "summary": "Change log All notable changes to the LaunchDarkly's EventSource implementation for C# will be documented in this file. This project adheres to Semantic Versioning. 5.3.0 (2025-12-16) Features adds headers to EventSourceServiceUnsuccessfulResponseException (a0d1b1f) 5.2.1 (2025-09-25) Bug Fixes Avoid showing authorization value in exception (#111) (e5f7933) 5.2.0 (2025-02-24) Features Report event source headers on open. (#104) (e2cba63) [5.1.0] - 2023-10-04 Changed: Update minimum LaunchDarkly.Logging version to 2.0.0 to share the same min version as SDK implementations. [5.0.1] - 2022-08-24 Changed: Relaxed dependency constraint to allow use of LaunchDarkly.Logging 1.x or 2.x. [5.0.0] - 2022-08-18 Changed: Removed EOL target framework .NET Framework 4.5.2. Lowest compatible platform versions are now .NET Core 3.1, .NET Framework 4.6.2, .NET 6.0, and .NET Standard 2.0. EventSource now considers any server response with an encoding other than UTF-8 to be invalid. The Server-Sent Events specification states that event streams must always use UTF-8. Removed: ConfigurationBuilder.DefaultEncoding (no longer relevant since the encoding must be UTF-8). [4.2.0] - 2022-04-19 Added: ConfigurationBuilder. HttpRequestModifier, for making custom modifications to outgoing HTTP requests. (Thanks, acquleo!) [4.1.3] - 2021-10-04 Changed: Updated LaunchDarkly.Logging dependency to 1.0.1, to match the version used in the latest server-side .NET SDK release. Since .NET Framework is stricter about dependency versions than .NET Core, it is desirable to keep transitive dependency versions in sync in all packages used by the SDK. [4.1.2] - 2021-05-17 Fixed: Fixed a memory leak in which a CancellationTokenSource instance was not disposed of after reading from the stream. This bug was introduced in the 4.0.0 release. (#77) [4.1.1] - 2021-05-04 (The 4.1.0 release was an accidental duplicate of 4.0.0 and did not include these changes.) Added: ConfigurationBuilder.ResponseStartTimeout-- added as a more accurately named replacement for ConnectionTimeout. Deprecated: ConfigurationBuilder.ConnectionTimeout [4.1.0] - 2021-05-04 This release was an accidental duplicate of 4.0.0. Please use 4.1.1 instead. [4.0.0] - 2021-02-22 Starting with this version, the API documentation for the latest release is viewable at https://launchdarkly.github.io/dotnet-eventsource. The 4.x major version of LaunchDarkly.EventSource will be used in the upcoming major version releases of LaunchDarkly's .NET-based SDKs. This release streamlines the API, updates platform compatibility, and improves performance. Added: EventSource.Restart: this method allows the caller to trigger a connection restart even if there was not an error on the stream. MessageEvent.Name: previously, the event name was only available as a property of MessageReceivedEventArgs. ConfigurationBuilder.DefaultEncoding: sets the character encoding to use for parsing the stream data if the server did not specify an encoding in its Content-Type. ConfigurationBuilder.PreferDataAsUtf8Bytes: an optional mode in which EventSource will read the data: property of events as a raw UTF-8 byte array (assuming the stream encoding is UTF-8) to avoid unnecessarily allocating a UTF-16 string. This is meant as an optimization for applications that will be processing the data with a UTF-8-based API such as System.Text.Json. Simple EventSource(Uri) constructor for cases where you do not need any other configuration options. Standard .NET XML documentation of all public types and methods is now produced in the build. The release now publishes a Source Link package. Changed: The minimum .NET Standard compatibility version is now 2.0. The minimum .NET Framework compatibility version is now 4.5.2. Logging now works through the new LaunchDarkly.Logging facade which is used by LaunchDarkly .NET-based SDKs, instead of Common.Logging. ConfigurationBuilder methods no longer throw any exceptions, except for one case: passing null for the stream URI. In all cases where a property has a maximum and/or minimum value, if you try to set a value outside that range it will simply be changed to the closest valid value. If two properties do not make sense to use together (such as a non-null HttpClient and a non-null HttpMessageHandler), one will simply override the other as described in the API documentation. ConfigurationBuilder.DelayRetryDuration is named to InitialRetryDelay, which more accurately describes its meaning. ConfigurationBuilder.MessageHandler is renamed to HttpMessageHandler, since that's the name of its type (also, \"message\" has other meanings in this API). The type of Configuration.HttpContentFactory is now simply Func&lt;HttpContent&gt; rather than using a custom delegate type. If you pass a Dictionary of headers to ConfigurationBuilder.RequestHeaders, it will now be copied. Previously the configuration retained a reference to the original Dictionary, which could cause problems if it was later modified. EventSource now implements the stream read timeout in a way that uses the task scheduler more efficiently. Previously, it executed an additional task for each read with Task.Delay; now, it uses a timed cancellation token. Exception messages have been rewritten for clarity and style. Fixed: ConfigurationBuilder.BackoffResetThreshold had no effect; the default value was being used regardless of what you set it to. When reading the SSE stream, EventSource was using a case-insensitive comparison to recognize field names like event and data. The SSE specification states that field name \"must be compared literally, with no case folding performed,\" so a field name like EVENT is invalid. Removed: Removed all types and methods that were marked as deprecated/obsolete in the last 3.x version. Configuration no longer has a public constructor. Instances must now be created with Configuration.Builder. The helper class ExponentialBackoffWithDecorrelation is no longer public. [3.4.0] - 2020-12-03 Added: You can now tell EventSource to use an HttpClient instance that you provide by calling ConfigurationBuilder.HttpClient. (Thanks, thorstenfleischmann!) [3.3.3] - 2020-11-05 Added: The package now has a specific target for .NET Standard 2.0, in addition to the previous targets of .NET Standard 1.4 and .NET Framework 4.5. There is no functional difference between the 2.0 and 1.4 builds, but it may be desirable for .NET Core/.NET Standard code to be able to avoid linking to any .NET Standard 1.x assemblies. [3.3.2] - 2019-10-23 Fixed: If a stream connection is restarted, EventSource should send a Last-Event-Id header if it previously received an event with an id field. (Thanks, fracek!) [3.3.1] - 2019-08-08 Fixed: If you don't explicitly provide an HttpMessageHandler in the configuration, EventSource will now use the default HttpClient constructor; previously, it would create an instance of the standard .NET HttpMessageHandler implementation and tell the HttpClient to use that. In .NET Framework and .NET Standard, this makes no difference, but in Xamarin, calling the default HttpClient constructor may allow it to use a better HTTP implementation based on native APIs. Expanded and improved documentation comments. [3.3.0] - 2019-03-26 Added: The EventSource now implements IDisposable. Calling Dispose() has the same effect as calling Close(). Fixed: Under some circumstances, a CancellationTokenSource might not be disposed of after making an HTTP request, which could cause a timer object to be leaked. [3.2.3] - 2019-01-14 Fixed: The assemblies in this package now have Authenticode signatures. The release note for 3.2.1 was an error; that release did not include signatures. [3.2.2] - 2019-01-09 Removed The console applications for manual testing have been removed (because the unit tests now include full end-to-end tests against a stub HTTP server). [3.2.1] - 2019-01-09 Changed The published assemblies are now digitally signed as well as strong-named. Also, they are now built in Release mode and do not contain debug information. [3.2.0] - 2018-10-24 Added Previously, the delay before reconnect attempts would increase exponentially only if the previous connection could not be made at all or returned an HTTP error; if it received an HTTP 200 status, the delay would be reset to the minimum even if the connection then immediately failed. Now, the new configuration property BackoffResetThreshold (default: 1 minute) specifies the length of time that a connection must stay active in order for the reconnect delay to be reset. (#37) Fixed Fixed an unobserved exception that could occur following a stream timeout, which could cause a crash in .NET 4.0. A NullReferenceException could sometimes be logged if a stream connection failed. (#24) [3.1.5] - 2018-08-29 Duplicate of 3.1.4, created due to a problem in the release process. [3.1.4] - 2018-08-29 Fixed Fixed a bug that prevented the event source from reconnecting to the stream if it received an HTTP error status from the server (as opposed to simply losing the connection). [3.1.3] - 2018-08-13 Fixed The reconnection attempt counter is no longer shared among all EventSource instances. Previously, if you connected to more than one stream, all but the first would behave as if they were reconnecting and would have a backoff delay. [3.1.2] - 2018-08-02 Changed The SDK was referencing some system assemblies via <PackageReference>, which could cause dependency conflicts. These have been changed to framework <Reference>s. A redundant reference to System.Runtime was removed. Fixed If the stream connection fails, there should be an increasing backoff interval before each reconnect attempt. Previously, it would log a message about waiting some number of milliseconds, but then not actually wait. [3.1.1] - 2018-06-28 Removed Removed an unused dependency on Newtonsoft.Json. [3.1.0] - 2018-06-01 Added The new class ConfigurationBuilder provides a validated fluent builder pattern for Configuration instances. The HTTP method and request body can now be specified in ConfigurationBuilder or in the Configuration constructor. The default is still to use GET and not send a request body. [3.0.0] - 2018-02-23 Changed Logging is now done via Common.Logging. Added EventSource now uses the interface IEventSource. [2.2.1] - 2018-02-05 Downgrade Microsoft.Extensions.Logging to 1.0.2 to reduce dependencies brought in when building against .NET Framework. [2.2.0] - 2018-01-19 Added Exposed EventSourceServiceCancelledException as a public class. Changed Removed unused and transitive dependencies. Added a reference to the Apache 2.0 license in LaunchDarkly.EventSource.csproj Improved logging. Thanks @JeffAshton! [2.1.1] - 2017-11-29 Changed Move from .NET Standard 1.6 to 1.4. [2.1.0] - 2017-11-16 Added Exposed the ExponentialBackoffWithDecorrelation as a public class. This class may be used to calculate exponential backoff with jitter. Changed Reconnects to EventSource are now handled inline, rather than using Polly for managing retry policies. [2.0.0] - 2017-10-11 Changed Removed the closeOnEndOfStream property. [1.1.0] 2017-10-02 Added ConnectToEventSourceAsync now takes in a new boolean parameter, closeOnEndOfStream, which, if true, will close the EventSource connection when the end of the stream is reached. Changed Fixed a bug causing causing read timeouts to never propogate. [1.0.1] 2017-09-27 Added Signed EventSource Assembly. Changed Change dependency on Polly to Polly-Signed. [1.0.0] 2017-09-22 Hello world!"
  },
  "CONTRIBUTING.html": {
    "href": "CONTRIBUTING.html",
    "title": "Contributing to the LaunchDarkly EventSource SSE Client | LaunchDarkly EventSource for .NET",
    "summary": "Contributing to the LaunchDarkly EventSource SSE Client LaunchDarkly has published an SDK contributor's guide that provides a detailed explanation of how our SDKs work. See below for additional information on how to contribute to this SDK. Submitting bug reports and feature requests The LaunchDarkly SDK team monitors the issue tracker in this repository. Bug reports and feature requests specific to this package should be filed in this issue tracker. The SDK team will respond to all newly filed issues within two business days. Submitting pull requests We encourage pull requests and other contributions from the community. Before submitting pull requests, ensure that all temporary or unintended code is removed. Don't worry about adding reviewers to the pull request; the LaunchDarkly SDK team will add themselves. The SDK team will acknowledge all pull requests within two business days. Build instructions Prerequisites This project has multiple target frameworks as described in README.md. The .NET Framework target can be built only in a Windows environment; the others can be built either with or without a Windows environment. Download and install the latest .NET SDK tools first. Building To install all required packages: dotnet restore To build all targets of the project without running any tests: dotnet build src/LaunchDarkly.EventSource Or, to build only the .NET Standard 2.0 target: dotnet build src/LaunchDarkly.EventSource -f netstandard2.0 Testing To run all unit tests, for all targets: dotnet test test/LaunchDarkly.EventSource.Tests Or, to run tests only for the .NET Standard 2.0 target (using the .NET Core 3.1 runtime): dotnet test test/LaunchDarkly.EventSource.Tests -f netcoreapp3.1 Note that the unit tests can only be run in Debug configuration. There is an InternalsVisibleTo directive that allows the test code to access internal members of the library, and assembly strong-naming in the Release configuration interferes with this."
  },
  "README.html": {
    "href": "README.html",
    "title": "LaunchDarkly EventSource SSE Client for .NET | LaunchDarkly EventSource for .NET",
    "summary": "LaunchDarkly EventSource SSE Client for .NET Overview The LaunchDarkly.EventSource package allows .NET developers to consume Server-Sent-Events (SSE) from a remote API. The SSE specification is defined here: https://html.spec.whatwg.org/multipage/server-sent-events.html Supported .NET versions This version of the library is built for the following targets: .NET Framework 4.6.2: runs on .NET Framework 4.6.2 and above. .NET Standard 2.0: runs on .NET Core 3.x or .NET 6.0+, or within a library that is targeted to .NET Standard 2.x. The .NET build tools should automatically load the most appropriate build of the library for whatever platform your application or library is targeted to. Signing The published version of this assembly is digitally signed with Authenticode and strong-named. Building the code locally in the default Debug configuration does not use strong-naming and does not require a key file. The public key file is in this repository at LaunchDarkly.EventSource.pk as well as here: Public key (hash algorithm: sha1): 002400000480000094000000060200000024000052534131000400000100010015ba095c5a95ac efa557867cec3f488906ec0ef6fe6728a7cfdeef861fcce49ea79357ba825d95d56d67597bc9cc 9a473438f5607908186fc477fdeafc68f387552061ebf57d6e585317d5047a57bd496034ff854a 417236776003bcba328fa8bf4a024c4d212ba4fb4033ebfb14116c12cde63d16551b9f48c20ee5 4a417deb Public key token is 18e8c36453e3060f Contributing We encourage pull requests and other contributions from the community. Check out our contributing guidelines for instructions on how to contribute to this project. About LaunchDarkly LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can: Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases. Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?). Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file. Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline. LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out our documentation for a complete list. Explore LaunchDarkly launchdarkly.com for more information docs.launchdarkly.com for our documentation and SDK reference guides apidocs.launchdarkly.com for our API documentation blog.launchdarkly.com for the latest product updates"
  },
  "api/LaunchDarkly.EventSource.CommentReceivedEventArgs.html": {
    "href": "api/LaunchDarkly.EventSource.CommentReceivedEventArgs.html",
    "title": "Class CommentReceivedEventArgs | LaunchDarkly EventSource for .NET",
    "summary": "Class CommentReceivedEventArgs Provides data recieved in the EventSource CommentReceived event. Inheritance object EventArgs CommentReceivedEventArgs Inherited Members EventArgs.Empty object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Namespace: LaunchDarkly.EventSource Assembly: LaunchDarkly.EventSource.dll Syntax public class CommentReceivedEventArgs : EventArgs Constructors | Edit this page View Source CommentReceivedEventArgs(string) Initializes a new instance of the CommentReceivedEventArgs class. Declaration public CommentReceivedEventArgs(string comment) Parameters Type Name Description string comment The comment received in the Server Sent Event. Properties | Edit this page View Source Comment Gets the comment received in the Server Sent Event. Declaration public string Comment { get; } Property Value Type Description string The comment. See Also EventArgs"
  },
  "api/LaunchDarkly.EventSource.Configuration.html": {
    "href": "api/LaunchDarkly.EventSource.Configuration.html",
    "title": "Class Configuration | LaunchDarkly EventSource for .NET",
    "summary": "Class Configuration An immutable class containing configuration properties for EventSource. Inheritance object Configuration Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.ReferenceEquals(object, object) object.ToString() Namespace: LaunchDarkly.EventSource Assembly: LaunchDarkly.EventSource.dll Syntax public sealed class Configuration Fields | Edit this page View Source DefaultBackoffResetThreshold The default value for BackoffResetThreshold(TimeSpan): one minute. Declaration public static readonly TimeSpan DefaultBackoffResetThreshold Field Value Type Description TimeSpan | Edit this page View Source DefaultConnectionTimeout Obsolete name for DefaultResponseStartTimeout. Declaration [Obsolete(\"Use DefaultResponseStartTimeout\")] public static readonly TimeSpan DefaultConnectionTimeout Field Value Type Description TimeSpan | Edit this page View Source DefaultInitialRetryDelay The default value for InitialRetryDelay(TimeSpan): one second. Declaration public static readonly TimeSpan DefaultInitialRetryDelay Field Value Type Description TimeSpan | Edit this page View Source DefaultLoggerName The logger name that will be used if you specified a logging implementation but did not provide a specific logger instance. Declaration public const string DefaultLoggerName = \"EventSource\" Field Value Type Description string See Also LogAdapter(ILogAdapter) | Edit this page View Source DefaultMaxRetryDelay The default value for MaxRetryDelay(TimeSpan): 30 seconds. Declaration public static readonly TimeSpan DefaultMaxRetryDelay Field Value Type Description TimeSpan | Edit this page View Source DefaultReadTimeout The default value for ReadTimeout(TimeSpan): 5 minutes. Declaration public static readonly TimeSpan DefaultReadTimeout Field Value Type Description TimeSpan | Edit this page View Source DefaultResponseStartTimeout The default value for ResponseStartTimeout(TimeSpan): 10 seconds. Declaration public static readonly TimeSpan DefaultResponseStartTimeout Field Value Type Description TimeSpan Properties | Edit this page View Source BackoffResetThreshold The amount of time a connection must stay open before the EventSource resets its backoff delay. Declaration public TimeSpan BackoffResetThreshold { get; } Property Value Type Description TimeSpan See Also BackoffResetThreshold(TimeSpan) | Edit this page View Source ConnectionTimeout Obsolete name for ResponseStartTimeout. Declaration [Obsolete(\"Use ResponseStartTimeout\")] public TimeSpan ConnectionTimeout { get; } Property Value Type Description TimeSpan | Edit this page View Source HttpClient The HttpClient that will be used as the HTTP client, or null for a new HttpClient. Declaration public HttpClient HttpClient { get; } Property Value Type Description HttpClient See Also HttpClient(HttpClient) | Edit this page View Source HttpMessageHandler The HttpMessageHandler that will be used for the HTTP client, or null for the default handler. Declaration public HttpMessageHandler HttpMessageHandler { get; } Property Value Type Description HttpMessageHandler See Also HttpMessageHandler(HttpMessageHandler) | Edit this page View Source HttpRequestModifier Delegate hook invoked before an HTTP request has been performed. Declaration public Action<HttpRequestMessage> HttpRequestModifier { get; } Property Value Type Description Action<HttpRequestMessage> See Also HttpRequestModifier(Action<HttpRequestMessage>) | Edit this page View Source InitialRetryDelay The initial amount of time to wait before attempting to reconnect to the EventSource API. Declaration public TimeSpan InitialRetryDelay { get; } Property Value Type Description TimeSpan See Also InitialRetryDelay(TimeSpan) | Edit this page View Source LastEventId Gets the last event identifier. Declaration public string LastEventId { get; } Property Value Type Description string See Also LastEventId(string) | Edit this page View Source Logger The logger to be used for all EventSource log output. Declaration public Logger Logger { get; } Property Value Type Description Logger Remarks This is never null; if logging is not configured, it will be LaunchDarkly.Logging.Logs.None. See Also Logger(Logger) | Edit this page View Source MaxRetryDelay The maximum amount of time to wait before attempting to reconnect. Declaration public TimeSpan MaxRetryDelay { get; } Property Value Type Description TimeSpan See Also MaxRetryDelay(TimeSpan) | Edit this page View Source Method The HTTP method that will be used when connecting to the EventSource API. Declaration public HttpMethod Method { get; } Property Value Type Description HttpMethod See Also Method(HttpMethod) | Edit this page View Source PreferDataAsUtf8Bytes Whether to use UTF-8 byte arrays internally if possible when reading the stream. Declaration public bool PreferDataAsUtf8Bytes { get; } Property Value Type Description bool See Also PreferDataAsUtf8Bytes(bool) | Edit this page View Source ReadTimeout The timeout when reading from the EventSource API. Declaration public TimeSpan ReadTimeout { get; } Property Value Type Description TimeSpan See Also ReadTimeout(TimeSpan) | Edit this page View Source RequestBodyFactory A factory for HTTP request body content, if the HTTP method is one that allows a request body. is one that allows a request body. This is in the form of a factory function because the request may need to be sent more than once. Declaration public Func<HttpContent> RequestBodyFactory { get; } Property Value Type Description Func<HttpContent> See Also RequestBodyFactory(Func<HttpContent>) | Edit this page View Source RequestHeaders The request headers to be sent with each EventSource HTTP request. Declaration public IDictionary<string, string> RequestHeaders { get; } Property Value Type Description IDictionary<string, string> See Also RequestHeader(string, string) RequestHeaders(IDictionary<string, string>) | Edit this page View Source ResponseStartTimeout The maximum amount of time to wait between starting an HTTP request and receiving the response headers. Declaration public TimeSpan ResponseStartTimeout { get; } Property Value Type Description TimeSpan See Also ResponseStartTimeout(TimeSpan) | Edit this page View Source Uri Gets the Uri used when connecting to an EventSource API. Declaration public Uri Uri { get; } Property Value Type Description Uri Methods | Edit this page View Source Builder(Uri) Provides a new ConfigurationBuilder for constructing a configuration. Declaration public static ConfigurationBuilder Builder(Uri uri) Parameters Type Name Description Uri uri the EventSource URI Returns Type Description ConfigurationBuilder a new builder instance Exceptions Type Condition ArgumentNullException if the URI is null See Also EventSource(Configuration) ConfigurationBuilder"
  },
  "api/LaunchDarkly.EventSource.ConfigurationBuilder.html": {
    "href": "api/LaunchDarkly.EventSource.ConfigurationBuilder.html",
    "title": "Class ConfigurationBuilder | LaunchDarkly EventSource for .NET",
    "summary": "Class ConfigurationBuilder A standard Builder pattern for constructing a Configuration instance. Inheritance object ConfigurationBuilder Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Namespace: LaunchDarkly.EventSource Assembly: LaunchDarkly.EventSource.dll Syntax public class ConfigurationBuilder Remarks Initialize a builder by calling new ConfigurationBuilder(uri) or Configuration.Builder(uri). The URI is always required; all other properties are set to defaults. Use the builder's setter methods to modify any desired properties; setter methods can be chained. Then call Build() to construct the final immutable Configuration. All setter methods will throw ArgumentException if called with an invalid value, so it is never possible for Build() to fail. Methods | Edit this page View Source BackoffResetThreshold(TimeSpan) Sets the amount of time a connection must stay open before the EventSource resets its backoff delay. Declaration public ConfigurationBuilder BackoffResetThreshold(TimeSpan backoffResetThreshold) Parameters Type Name Description TimeSpan backoffResetThreshold the threshold time Returns Type Description ConfigurationBuilder the builder Remarks If a connection fails before the threshold has elapsed, the delay before reconnecting will be greater than the last delay; if it fails after the threshold, the delay will start over at the initial minimum value. This prevents long delays from occurring on connections that are only rarely restarted. The default value is DefaultBackoffResetThreshold. Negative values are changed to zero. | Edit this page View Source Build() Constructs a Configuration instance based on the current builder properies. Declaration public Configuration Build() Returns Type Description Configuration the configuration | Edit this page View Source ConnectionTimeout(TimeSpan) Obsolete name for ResponseStartTimeout(TimeSpan). Declaration [Obsolete(\"Use ResponseStartTimeout\")] public ConfigurationBuilder ConnectionTimeout(TimeSpan responseStartTimeout) Parameters Type Name Description TimeSpan responseStartTimeout the timeout Returns Type Description ConfigurationBuilder the builder | Edit this page View Source HttpClient(HttpClient) Specifies that EventSource should use a specific HttpClient instance for HTTP requests. Declaration public ConfigurationBuilder HttpClient(HttpClient client) Parameters Type Name Description HttpClient client an HttpClient instance, or null to use the default behavior Returns Type Description ConfigurationBuilder the builder Remarks Normally, EventSource creates its own HttpClient and disposes of it when you dispose of the EventSource. If you provide your own HttpClient using this method, you are responsible for managing the HttpClient's lifecycle-- EventSource will not dispose of it. EventSource will not modify this client's properties, so if you call HttpMessageHandler(HttpMessageHandler) or ConnectionTimeout(TimeSpan), those methods will be ignored. | Edit this page View Source HttpMessageHandler(HttpMessageHandler) Sets the HttpMessageHandler that will be used for the HTTP client, or null for the default handler. Declaration public ConfigurationBuilder HttpMessageHandler(HttpMessageHandler handler) Parameters Type Name Description HttpMessageHandler handler the message handler implementation Returns Type Description ConfigurationBuilder the builder Remarks If you have specified a custom HTTP client instance with HttpClient(HttpClient), then HttpMessageHandler(HttpMessageHandler) is ignored. | Edit this page View Source HttpRequestModifier(Action<HttpRequestMessage>) Sets a delegate hook invoked before an HTTP request is performed. This may be useful if you want to modify some properties of the request that EventSource doesn't already have an option for. Declaration public ConfigurationBuilder HttpRequestModifier(Action<HttpRequestMessage> httpRequestModifier) Parameters Type Name Description Action<HttpRequestMessage> httpRequestModifier code that will be called with the request before it is sent Returns Type Description ConfigurationBuilder the builder | Edit this page View Source InitialRetryDelay(TimeSpan) Sets the initial amount of time to wait before attempting to reconnect to the EventSource API. Declaration public ConfigurationBuilder InitialRetryDelay(TimeSpan initialRetryDelay) Parameters Type Name Description TimeSpan initialRetryDelay the initial retry delay Returns Type Description ConfigurationBuilder the builder Remarks If the connection fails more than once, the retry delay will increase from this value using a backoff algorithm. The default value is DefaultInitialRetryDelay. Negative values are changed to zero. The actual duration of each delay will vary slightly because there is a random jitter factor to avoid clients all reconnecting at once. See Also MaxRetryDelay(TimeSpan) | Edit this page View Source LastEventId(string) Sets the last event identifier. Declaration public ConfigurationBuilder LastEventId(string lastEventId) Parameters Type Name Description string lastEventId the event identifier Returns Type Description ConfigurationBuilder the builder Remarks Setting this value will cause EventSource to add a \"Last-Event-ID\" header in its HTTP request. This normally corresponds to the LastEventId field of a previously received event. | Edit this page View Source LogAdapter(ILogAdapter) Sets the logging implementation to be used for all EventSource log output. Declaration public ConfigurationBuilder LogAdapter(ILogAdapter logAdapter) Parameters Type Name Description ILogAdapter logAdapter a LaunchDarkly.Logging.ILogAdapter Returns Type Description ConfigurationBuilder the builder Remarks This uses the ILogAdapter abstraction from the LaunchDarkly.Logging library, which provides several basic implementations such as Logs.ToConsole and an integration with the .NET Core logging framework. For more about this and about adapters to other logging frameworks, see LaunchDarkly.Logging. LaunchDarkly.Logging defines logging levels of Debug, Info, Warn, and Error. If you do not want detailed Debug-level logging, use the Level() modifier to set a minimum level of Info or above, as shown in the code example (unless you are using an adapter to another logging framework that has its own way of doing log filtering). Log messages will use DefaultLoggerName as the logger name. If you want to specify a different logger name, use Logger(Logger). If you don't specify LogAdapter(ILogAdapter) or Logger(Logger), EventSource will not do any logging. Examples using LaunchDarkly.Logging; // Send log output to the console (standard error), suppressing Debug messages var config = new ConfigurationBuilder(uri). LogAdapter(Logs.ToConsole.Level(LogLevel.Info)). Build(); | Edit this page View Source Logger(Logger) Sets a custom logger to be used for all EventSource log output. Declaration public ConfigurationBuilder Logger(Logger logger) Parameters Type Name Description Logger logger a LaunchDarkly.Logging.Logger instance Returns Type Description ConfigurationBuilder the builder Remarks This uses the Logger type from the LaunchDarkly.Logging library, which provides several basic implementations such as Logs.ToConsole and an integration with the .NET Core logging framework. For more about this and about adapters to other logging frameworks, see LaunchDarkly.Logging. If you don't specify LogAdapter(ILogAdapter) or Logger(Logger), EventSource will not do any logging. Examples using LaunchDarkly.Logging; // Define a logger that sends output to the console (standard output), suppressing // Debug messages, and using a logger name of \"EventStream\" var logger = Logs.ToConsole.Level(LogLevel.Info).Logger(\"EventStream\"); var config = new ConfigurationBuilder(uri). Logger(logger). Build(); | Edit this page View Source MaxRetryDelay(TimeSpan) Sets the maximum amount of time to wait before attempting to reconnect. Declaration public ConfigurationBuilder MaxRetryDelay(TimeSpan maxRetryDelay) Parameters Type Name Description TimeSpan maxRetryDelay the maximum retry delay Returns Type Description ConfigurationBuilder the builder Remarks EventSource uses an exponential backoff algorithm (with random jitter) so that the delay between reconnections starts at InitialRetryDelay(TimeSpan) but increases with each subsequent attempt. MaxRetryDelay sets a limit on how long the delay can be. The default value is DefaultMaxRetryDelay. Negative values are changed to zero. See Also InitialRetryDelay(TimeSpan) | Edit this page View Source Method(HttpMethod) Sets the HTTP method that will be used when connecting to the EventSource API. Declaration public ConfigurationBuilder Method(HttpMethod method) Parameters Type Name Description HttpMethod method Returns Type Description ConfigurationBuilder Remarks By default, this is Get. | Edit this page View Source PreferDataAsUtf8Bytes(bool) Specifies whether to use UTF-8 byte arrays internally if possible when reading the stream. Declaration public ConfigurationBuilder PreferDataAsUtf8Bytes(bool preferDataAsUtf8Bytes) Parameters Type Name Description bool preferDataAsUtf8Bytes true if you intend to request the event data as UTF-8 bytes Returns Type Description ConfigurationBuilder the builder Remarks As described in MessageEvent, in some applications it may be preferable to store and process event data as UTF-8 byte arrays rather than strings. By default, EventSource will use the string type when processing the event stream; if you then use DataUtf8Bytes to get the data, it will be converted to a byte array as needed. However, if you set PreferDataAsUtf8Bytes to true, the event data will be stored internally as a UTF-8 byte array so that if you read DataUtf8Bytes, you will get the same array with no extra copying or conversion. Therefore, for greatest efficiency you should set this to true if you intend to process the data as UTF-8. Note that Server-Sent Event streams always use UTF-8 encoding, as required by the SSE specification. | Edit this page View Source ReadTimeout(TimeSpan) Sets the timeout when reading from the EventSource API. Declaration public ConfigurationBuilder ReadTimeout(TimeSpan readTimeout) Parameters Type Name Description TimeSpan readTimeout Returns Type Description ConfigurationBuilder Remarks The connection will be automatically dropped and restarted if the server sends no data within this interval. This prevents keeping a stale connection that may no longer be working. It is common for SSE servers to send a simple comment line (\":\") as a heartbeat to prevent timeouts. The default value is DefaultReadTimeout. | Edit this page View Source RequestBody(string, string) Equivalent RequestBodyFactory(Func<HttpContent>), but for content that is a simple string. Declaration public ConfigurationBuilder RequestBody(string bodyString, string contentType) Parameters Type Name Description string bodyString the content string contentType the Content-Type header Returns Type Description ConfigurationBuilder the builder | Edit this page View Source RequestBodyFactory(Func<HttpContent>) Sets a factory for HTTP request body content, if the HTTP method is one that allows a request body. Declaration public ConfigurationBuilder RequestBodyFactory(Func<HttpContent> factory) Parameters Type Name Description Func<HttpContent> factory the factory function, or null for none Returns Type Description ConfigurationBuilder the builder Remarks This is in the form of a factory function because the request may need to be sent more than once. | Edit this page View Source RequestHeader(string, string) Adds a request header to be sent with each EventSource HTTP request. Declaration public ConfigurationBuilder RequestHeader(string name, string value) Parameters Type Name Description string name the header name string value the header value Returns Type Description ConfigurationBuilder the builder | Edit this page View Source RequestHeaders(IDictionary<string, string>) Sets the request headers to be sent with each EventSource HTTP request. Declaration public ConfigurationBuilder RequestHeaders(IDictionary<string, string> headers) Parameters Type Name Description IDictionary<string, string> headers the headers (null is equivalent to an empty dictionary) Returns Type Description ConfigurationBuilder the builder | Edit this page View Source ResponseStartTimeout(TimeSpan) Sets the maximum amount of time EventSource will wait between starting an HTTP request and receiving the response headers. Declaration public ConfigurationBuilder ResponseStartTimeout(TimeSpan responseStartTimeout) Parameters Type Name Description TimeSpan responseStartTimeout the timeout Returns Type Description ConfigurationBuilder Remarks This is the same as the Timeout property in .NET's HttpClient. The default value is DefaultConnectionTimeout. It is not the same as a TCP connection timeout. A connection timeout would include only the time of establishing the connection, not the time it takes for the server to prepare the beginning of the response. .NET does not consistently support a connection timeout, but if you are using .NET Core or .NET 5+ you can implement it by using SocketsHttpHandler as your HttpMessageHandler(HttpMessageHandler) and setting the ConnectTimeout property there."
  },
  "api/LaunchDarkly.EventSource.EventSource.html": {
    "href": "api/LaunchDarkly.EventSource.EventSource.html",
    "title": "Class EventSource | LaunchDarkly EventSource for .NET",
    "summary": "Class EventSource Provides an EventSource client for consuming Server-Sent Events. Additional details on the Server-Sent Events spec can be found at https://html.spec.whatwg.org/multipage/server-sent-events.html Inheritance object EventSource Implements IEventSource IDisposable Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Namespace: LaunchDarkly.EventSource Assembly: LaunchDarkly.EventSource.dll Syntax public class EventSource : IEventSource, IDisposable Constructors | Edit this page View Source EventSource(Configuration) Initializes a new instance of the EventSource class. Declaration public EventSource(Configuration configuration) Parameters Type Name Description Configuration configuration the configuration | Edit this page View Source EventSource(Uri) Shortcut for initializing an EventSource with only a stream URI and no custom properties. Declaration public EventSource(Uri uri) Parameters Type Name Description Uri uri the stream URI Exceptions Type Condition ArgumentNullException if the URI is null Properties | Edit this page View Source ReadyState Gets the state of the EventSource connection. Declaration public ReadyState ReadyState { get; } Property Value Type Description ReadyState Methods | Edit this page View Source Close() Closes the connection to the SSE server. The EventSource cannot be reopened after this. Declaration public void Close() | Edit this page View Source Dispose() Equivalent to calling Close(). Declaration public void Dispose() | Edit this page View Source Restart(bool) Triggers the same \"close and retry\" behavior as if an error had been encountered on the stream. Declaration public void Restart(bool resetBackoffDelay) Parameters Type Name Description bool resetBackoffDelay true if the delay before reconnection should be reset to the lowest level (InitialRetryDelay(TimeSpan)); false if it should increase according to the usual exponential backoff logic Remarks If the stream is currently active, this closes the connection, waits for some amount of time as determined by the usual backoff behavior (and resetBackoffDelay), and then attempts to reconnect. If the stream is not yet connected, is already waiting to reconnect, or has been permanently shut down, this has no effect. The method returns immediately without waiting for the reconnection to happen. You will receive Closed and Opened events when it does happen (or an Error event if the new connection attempt fails). | Edit this page View Source StartAsync() Initiates a connection to the SSE server and begins parsing events. Declaration public Task StartAsync() Returns Type Description Task a Task that will be completed only when the EventSource is closed Exceptions Type Condition InvalidOperationException if the method was called again after the stream connection was already active Events | Edit this page View Source Closed Occurs when the connection to the EventSource API has been closed. Declaration public event EventHandler<StateChangedEventArgs> Closed Event Type Type Description EventHandler<StateChangedEventArgs> | Edit this page View Source CommentReceived Occurs when a comment has been received from the EventSource API. Declaration public event EventHandler<CommentReceivedEventArgs> CommentReceived Event Type Type Description EventHandler<CommentReceivedEventArgs> | Edit this page View Source Error Occurs when an error has happened when the EventSource is open and processing Server Sent Events. Declaration public event EventHandler<ExceptionEventArgs> Error Event Type Type Description EventHandler<ExceptionEventArgs> | Edit this page View Source MessageReceived Occurs when a Server Sent Event from the EventSource API has been received. Declaration public event EventHandler<MessageReceivedEventArgs> MessageReceived Event Type Type Description EventHandler<MessageReceivedEventArgs> | Edit this page View Source Opened Occurs when the connection to the EventSource API has been opened. Declaration public event EventHandler<StateChangedEventArgs> Opened Event Type Type Description EventHandler<StateChangedEventArgs> Implements IEventSource IDisposable"
  },
  "api/LaunchDarkly.EventSource.EventSourceServiceCancelledException.html": {
    "href": "api/LaunchDarkly.EventSource.EventSourceServiceCancelledException.html",
    "title": "Class EventSourceServiceCancelledException | LaunchDarkly EventSource for .NET",
    "summary": "Class EventSourceServiceCancelledException General superclass for exceptions that caused the EventSource to disconnect or fail to establish a connection. Inheritance object Exception EventSourceServiceCancelledException EventSourceServiceUnsuccessfulResponseException Implements ISerializable Inherited Members Exception.GetBaseException() Exception.GetObjectData(SerializationInfo, StreamingContext) Exception.GetType() Exception.ToString() Exception.Data Exception.HelpLink Exception.HResult Exception.InnerException Exception.Message Exception.Source Exception.StackTrace Exception.TargetSite Exception.SerializeObjectState object.Equals(object) object.Equals(object, object) object.GetHashCode() object.MemberwiseClone() object.ReferenceEquals(object, object) Namespace: LaunchDarkly.EventSource Assembly: LaunchDarkly.EventSource.dll Syntax public class EventSourceServiceCancelledException : Exception, ISerializable Constructors | Edit this page View Source EventSourceServiceCancelledException(string) Creates a new instance. Declaration public EventSourceServiceCancelledException(string message) Parameters Type Name Description string message the exception message | Edit this page View Source EventSourceServiceCancelledException(string, Exception) Creates a new instance with an inner exception. Declaration public EventSourceServiceCancelledException(string message, Exception innerException) Parameters Type Name Description string message the exception message Exception innerException the inner exception Implements ISerializable"
  },
  "api/LaunchDarkly.EventSource.EventSourceServiceUnsuccessfulResponseException.html": {
    "href": "api/LaunchDarkly.EventSource.EventSourceServiceUnsuccessfulResponseException.html",
    "title": "Class EventSourceServiceUnsuccessfulResponseException | LaunchDarkly EventSource for .NET",
    "summary": "Class EventSourceServiceUnsuccessfulResponseException Indicates that the EventSource was able to establish an HTTP connection, but received a non-successful status code. Inheritance object Exception EventSourceServiceCancelledException EventSourceServiceUnsuccessfulResponseException Implements ISerializable Inherited Members Exception.GetBaseException() Exception.GetObjectData(SerializationInfo, StreamingContext) Exception.GetType() Exception.ToString() Exception.Data Exception.HelpLink Exception.HResult Exception.InnerException Exception.Message Exception.Source Exception.StackTrace Exception.TargetSite Exception.SerializeObjectState object.Equals(object) object.Equals(object, object) object.GetHashCode() object.MemberwiseClone() object.ReferenceEquals(object, object) Namespace: LaunchDarkly.EventSource Assembly: LaunchDarkly.EventSource.dll Syntax public class EventSourceServiceUnsuccessfulResponseException : EventSourceServiceCancelledException, ISerializable Constructors | Edit this page View Source EventSourceServiceUnsuccessfulResponseException(int) Creates a new instance. Declaration public EventSourceServiceUnsuccessfulResponseException(int statusCode) Parameters Type Name Description int statusCode the HTTP status code of the response | Edit this page View Source EventSourceServiceUnsuccessfulResponseException(int, IEnumerable<KeyValuePair<string, IEnumerable<string>>>) Creates a new instance with headers. Declaration public EventSourceServiceUnsuccessfulResponseException(int statusCode, IEnumerable<KeyValuePair<string, IEnumerable<string>>> headers) Parameters Type Name Description int statusCode the HTTP status code of the response IEnumerable<KeyValuePair<string, IEnumerable<string>>> headers the HTTP headers from the response Properties | Edit this page View Source Headers The HTTP headers from the response. Declaration public IEnumerable<KeyValuePair<string, IEnumerable<string>>> Headers { get; } Property Value Type Description IEnumerable<KeyValuePair<string, IEnumerable<string>>> | Edit this page View Source StatusCode The HTTP status code of the response. Declaration public int StatusCode { get; } Property Value Type Description int Implements ISerializable"
  },
  "api/LaunchDarkly.EventSource.ExceptionEventArgs.html": {
    "href": "api/LaunchDarkly.EventSource.ExceptionEventArgs.html",
    "title": "Class ExceptionEventArgs | LaunchDarkly EventSource for .NET",
    "summary": "Class ExceptionEventArgs Provides exception data raised in the EventSource Error event. Inheritance object EventArgs ExceptionEventArgs Inherited Members EventArgs.Empty object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Namespace: LaunchDarkly.EventSource Assembly: LaunchDarkly.EventSource.dll Syntax public class ExceptionEventArgs : EventArgs Constructors | Edit this page View Source ExceptionEventArgs(Exception) Initializes a new instance of the ExceptionEventArgs class. Declaration public ExceptionEventArgs(Exception ex) Parameters Type Name Description Exception ex A Exception that represents the error that occurred. Properties | Edit this page View Source Exception Gets the Exception that represents the error that occurred. Declaration public Exception Exception { get; } Property Value Type Description Exception The exception. See Also EventArgs"
  },
  "api/LaunchDarkly.EventSource.IEventSource.html": {
    "href": "api/LaunchDarkly.EventSource.IEventSource.html",
    "title": "Interface IEventSource | LaunchDarkly EventSource for .NET",
    "summary": "Interface IEventSource This interface defines the public members of EventSource. Namespace: LaunchDarkly.EventSource Assembly: LaunchDarkly.EventSource.dll Syntax public interface IEventSource Properties | Edit this page View Source ReadyState Gets the state of the EventSource connection. Declaration ReadyState ReadyState { get; } Property Value Type Description ReadyState Methods | Edit this page View Source Close() Closes the connection to the SSE server. The EventSource cannot be reopened after this. Declaration void Close() | Edit this page View Source Restart(bool) Triggers the same \"close and retry\" behavior as if an error had been encountered on the stream. Declaration void Restart(bool resetBackoffDelay) Parameters Type Name Description bool resetBackoffDelay true if the delay before reconnection should be reset to the lowest level (InitialRetryDelay(TimeSpan)); false if it should increase according to the usual exponential backoff logic Remarks If the stream is currently active, this closes the connection, waits for some amount of time as determined by the usual backoff behavior (and resetBackoffDelay), and then attempts to reconnect. If the stream is not yet connected, is already waiting to reconnect, or has been permanently shut down, this has no effect. The method returns immediately without waiting for the reconnection to happen. You will receive Closed and Opened events when it does happen (or an Error event if the new connection attempt fails). | Edit this page View Source StartAsync() Initiates a connection to the SSE server and begins parsing events. Declaration Task StartAsync() Returns Type Description Task a Task that will be completed only when the EventSource is closed Exceptions Type Condition InvalidOperationException if the method was called again after the stream connection was already active Events | Edit this page View Source Closed Occurs when the connection to the EventSource API has been closed. Declaration event EventHandler<StateChangedEventArgs> Closed Event Type Type Description EventHandler<StateChangedEventArgs> | Edit this page View Source CommentReceived Occurs when a comment has been received from the EventSource API. Declaration event EventHandler<CommentReceivedEventArgs> CommentReceived Event Type Type Description EventHandler<CommentReceivedEventArgs> | Edit this page View Source Error Occurs when an error has happened when the EventSource is open and processing Server Sent Events. Declaration event EventHandler<ExceptionEventArgs> Error Event Type Type Description EventHandler<ExceptionEventArgs> | Edit this page View Source MessageReceived Occurs when a Server Sent Event from the EventSource API has been received. Declaration event EventHandler<MessageReceivedEventArgs> MessageReceived Event Type Type Description EventHandler<MessageReceivedEventArgs> | Edit this page View Source Opened Occurs when the connection to the EventSource API has been opened. Declaration event EventHandler<StateChangedEventArgs> Opened Event Type Type Description EventHandler<StateChangedEventArgs>"
  },
  "api/LaunchDarkly.EventSource.MessageEvent.html": {
    "href": "api/LaunchDarkly.EventSource.MessageEvent.html",
    "title": "Struct MessageEvent | LaunchDarkly EventSource for .NET",
    "summary": "Struct MessageEvent Represents the Server-Sent Event message received from a stream. Inherited Members ValueType.ToString() object.Equals(object, object) object.GetType() object.ReferenceEquals(object, object) Namespace: LaunchDarkly.EventSource Assembly: LaunchDarkly.EventSource.dll Syntax public struct MessageEvent Remarks An SSE event consists of an event name (defaulting to \"message\" if not specified), a data string, and an optional \"ID\" string that the server may provide. The event name and ID properties are always stored as strings. By default, the data property is also stored as a string. However, in some applications, it may be desirable to represent the data as a UTF-8 byte array (for instance, if you are using the System.Text.Json API to parse JSON data). Since strings in .NET use two-byte UTF-16 characters, if you have a large block of UTF-8 data it is considerably more efficient to process it in its original form rather than converting it to or from a string. EventSource stores data as strings by default, but you set PreferDataAsUtf8Bytes(bool) it can store the raw UTF-8 data instead. In either case, MessageEvent will convert types transparently so that you can read either Data or DataUtf8Bytes. Constructors | Edit this page View Source MessageEvent(string, Utf8ByteSpan, string, Uri) Initializes a new instance of the MessageEvent class, providing the data as a UTF-8 byte span. Declaration public MessageEvent(string name, Utf8ByteSpan dataUtf8Bytes, string lastEventId, Uri origin) Parameters Type Name Description string name the event name Utf8ByteSpan dataUtf8Bytes the data received in the server-sent event; the MessageEvent will store a reference to the byte array, rather than copying it, so it should not be modified afterward by the caller string lastEventId the last event identifier, or null Uri origin the origin URI of the stream | Edit this page View Source MessageEvent(string, string, string, Uri) Initializes a new instance of the MessageEvent class. Declaration public MessageEvent(string name, string data, string lastEventId, Uri origin) Parameters Type Name Description string name the event name string data the data received in the server-sent event string lastEventId the last event identifier, or null Uri origin the origin URI of the stream | Edit this page View Source MessageEvent(string, string, Uri) Initializes a new instance of the MessageEvent class. Declaration public MessageEvent(string name, string data, Uri origin) Parameters Type Name Description string name the event name string data the data received in the server-sent event Uri origin the origin URI of the stream Remarks The LastEventId will be initialized to null. Fields | Edit this page View Source DefaultName The default value of Name if the SSE stream did not specify an event: field. Declaration public const string DefaultName = \"message\" Field Value Type Description string Properties | Edit this page View Source Data Gets the data received in the event as a string. Declaration public string Data { get; } Property Value Type Description string Remarks This is the value of the data: field in the SSE data; if there are multiple data: lines for a single event, they are concatenated with \"\\n\". If the data was originally stored as a string, the same string is returned. If it was stored as a UTF-8 byte array, the bytes are copied to a new string. | Edit this page View Source DataUtf8Bytes Gets the data received in the event as a UTF-8 byte span. Declaration public Utf8ByteSpan DataUtf8Bytes { get; } Property Value Type Description Utf8ByteSpan Remarks This is the value of the data: field in the SSE data; if there are multiple data: lines for a single event, they are concatenated with \"\\n\". If the data was originally stored as UTF-8 bytes, the returned value refers to the same array, offset, and length (it is the caller's responsibility not to modify the byte array). If it was originally stored as a string, the string is copied to a new byte array. | Edit this page View Source IsDataUtf8Bytes True if the event data is stored internally as UTF-8 bytes. Declaration public bool IsDataUtf8Bytes { get; } Property Value Type Description bool Remarks The data can be accessed with either Data or DataUtf8Bytes regardless of the value of this property. The property only indicates the original format of the data, so, for instance, if it is true then reading Data will have more overhead (due to copying) than reading DataUtf8Bytes. | Edit this page View Source LastEventId Gets the last event identifier received in the server-sent event. Declaration public string LastEventId { get; } Property Value Type Description string Remarks This is the value of the id: field in the SSE data. If there is no such field, it is null. You can use a previously received LastEventId value with LastEventId(string) when starting a new EventSource to tell the server what the last event you received was, although not all servers support this. | Edit this page View Source Name The event name. Declaration public string Name { get; } Property Value Type Description string Remarks This can be specified by the server in the event: field in the SSE data, as in event: my-event-name. If there is no event: field, the default name is DefaultName. | Edit this page View Source Origin Gets the origin URI of the stream that generated the server-sent event. Declaration public Uri Origin { get; } Property Value Type Description Uri Methods | Edit this page View Source Equals(object) Determines whether the specified object is equal to this instance. Declaration public override bool Equals(object obj) Parameters Type Name Description object obj the object to compare with this instance Returns Type Description bool true if the instances are equal Overrides ValueType.Equals(object) Remarks This method is potentially inefficient and should be used only in testing. | Edit this page View Source GetHashCode() Returns a hash code for this instance. Declaration public override int GetHashCode() Returns Type Description int A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. This method is potentially inefficient and should be used only in testing. Overrides ValueType.GetHashCode()"
  },
  "api/LaunchDarkly.EventSource.MessageReceivedEventArgs.html": {
    "href": "api/LaunchDarkly.EventSource.MessageReceivedEventArgs.html",
    "title": "Class MessageReceivedEventArgs | LaunchDarkly EventSource for .NET",
    "summary": "Class MessageReceivedEventArgs The parameter type for a MessageReceived event handler. Inheritance object EventArgs MessageReceivedEventArgs Inherited Members EventArgs.Empty object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Namespace: LaunchDarkly.EventSource Assembly: LaunchDarkly.EventSource.dll Syntax public class MessageReceivedEventArgs : EventArgs Constructors | Edit this page View Source MessageReceivedEventArgs(MessageEvent) Initializes a new instance. Declaration public MessageReceivedEventArgs(MessageEvent message) Parameters Type Name Description MessageEvent message the MessageEvent received from the stream Properties | Edit this page View Source EventName Shortcut for getting the Name property of the event. Declaration public string EventName { get; } Property Value Type Description string | Edit this page View Source Message A MessageEvent representing the event that was received from the SSE stream. Declaration public MessageEvent Message { get; } Property Value Type Description MessageEvent See Also EventArgs"
  },
  "api/LaunchDarkly.EventSource.ReadTimeoutException.html": {
    "href": "api/LaunchDarkly.EventSource.ReadTimeoutException.html",
    "title": "Class ReadTimeoutException | LaunchDarkly EventSource for .NET",
    "summary": "Class ReadTimeoutException An exception that indicates that the configured read timeout elapsed without receiving any new data from the server. Inheritance object Exception ReadTimeoutException Implements ISerializable Inherited Members Exception.GetBaseException() Exception.GetObjectData(SerializationInfo, StreamingContext) Exception.GetType() Exception.ToString() Exception.Data Exception.HelpLink Exception.HResult Exception.InnerException Exception.Source Exception.StackTrace Exception.TargetSite Exception.SerializeObjectState object.Equals(object) object.Equals(object, object) object.GetHashCode() object.MemberwiseClone() object.ReferenceEquals(object, object) Namespace: LaunchDarkly.EventSource Assembly: LaunchDarkly.EventSource.dll Syntax public class ReadTimeoutException : Exception, ISerializable Remarks Socket connections can fail silently, in which case an EventSource client without a read timeout would hang forever waiting for new data. A read timeout allows you to make a new stream connection in this case. The server can send periodic comment lines (\":\\n\") to keep the client from timing out if the connection is still working. Constructors View Source ReadTimeoutException() Declaration public ReadTimeoutException() Properties | Edit this page View Source Message Declaration public override string Message { get; } Property Value Type Description string Overrides Exception.Message Implements ISerializable"
  },
  "api/LaunchDarkly.EventSource.ReadyState.html": {
    "href": "api/LaunchDarkly.EventSource.ReadyState.html",
    "title": "Enum ReadyState | LaunchDarkly EventSource for .NET",
    "summary": "Enum ReadyState Represents the state of the connection in the EventSource class. Namespace: LaunchDarkly.EventSource Assembly: LaunchDarkly.EventSource.dll Syntax public enum ReadyState Fields Name Description Closed The connection is closed. This could also occur when an error is received. Connecting The connection has not yet been established, or it was closed and is reconnecting. Open The connection is open and is processing events as it receives them. Raw The initial state of the connection. Shutdown The connection has been shutdown explicitly by the consumer using the Close() method."
  },
  "api/LaunchDarkly.EventSource.StateChangedEventArgs.html": {
    "href": "api/LaunchDarkly.EventSource.StateChangedEventArgs.html",
    "title": "Class StateChangedEventArgs | LaunchDarkly EventSource for .NET",
    "summary": "Class StateChangedEventArgs Provides data for the state of the EventSource connection. Inheritance object EventArgs StateChangedEventArgs Inherited Members EventArgs.Empty object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Namespace: LaunchDarkly.EventSource Assembly: LaunchDarkly.EventSource.dll Syntax public class StateChangedEventArgs : EventArgs Constructors | Edit this page View Source StateChangedEventArgs(ReadyState, IEnumerable<KeyValuePair<string, IEnumerable<string>>>) Initializes a new instance of the StateChangedEventArgs class. Declaration public StateChangedEventArgs(ReadyState readyState, IEnumerable<KeyValuePair<string, IEnumerable<string>>> headers = null) Parameters Type Name Description ReadyState readyState One of the ReadyState values, which represents the state of the EventSource connection. IEnumerable<KeyValuePair<string, IEnumerable<string>>> headers Response headers when the ReadyState is Open. Otherwise null. Properties | Edit this page View Source Headers Get the response headers. Only populated for Open. A collection of header values when the ReadyState is Open, or null. Declaration public IEnumerable<KeyValuePair<string, IEnumerable<string>>> Headers { get; } Property Value Type Description IEnumerable<KeyValuePair<string, IEnumerable<string>>> | Edit this page View Source ReadyState Gets the state of the EventSource connection. Declaration public ReadyState ReadyState { get; } Property Value Type Description ReadyState One of the ReadyState values, which represents the state of the EventSource connection. See Also EventArgs"
  },
  "api/LaunchDarkly.EventSource.Utf8ByteSpan.html": {
    "href": "api/LaunchDarkly.EventSource.Utf8ByteSpan.html",
    "title": "Struct Utf8ByteSpan | LaunchDarkly EventSource for .NET",
    "summary": "Struct Utf8ByteSpan Points to a span of UTF-8-encoded text in a buffer. Inherited Members ValueType.Equals(object) ValueType.GetHashCode() ValueType.ToString() object.Equals(object, object) object.GetType() object.ReferenceEquals(object, object) Namespace: LaunchDarkly.EventSource Assembly: LaunchDarkly.EventSource.dll Syntax public struct Utf8ByteSpan Remarks This is similar to the Span type in .NET 5. It is used internally by EventSource to store event data if the stream is using UTF-8 encoding. If so, reading DataUtf8Bytes will return the same byte array, to avoid unnecessary copying. Constructors | Edit this page View Source Utf8ByteSpan(byte[], int, int) Constructs a new instance. Declaration public Utf8ByteSpan(byte[] data, int offset, int length) Parameters Type Name Description byte[] data The byte array containing the data. int offset The offset of the first relevant byte of data within the array. int length The number of bytes of relevant data within the array. | Edit this page View Source Utf8ByteSpan(string) Constructs a new instance by copying a string. Declaration public Utf8ByteSpan(string s) Parameters Type Name Description string s A string to convert to UTF-8 bytes. Properties | Edit this page View Source Data The byte array containing the data. May be null if Length is zero. Declaration public byte[] Data { get; } Property Value Type Description byte[] Remarks It is the caller's responsibility not to modify the array. | Edit this page View Source Length The number of bytes of relevant data within the array. This may be less than Data.Length if the span represents a subset of a larger buffer. Declaration public int Length { get; } Property Value Type Description int | Edit this page View Source Offset The offset of the first relevant byte of data within the array. This may be greater than zero if the span represents a subset of a larger buffer. Declaration public int Offset { get; } Property Value Type Description int Methods | Edit this page View Source Equals(Utf8ByteSpan) Tests whether the bytes in this span are the same as another span. Declaration public bool Equals(Utf8ByteSpan other) Parameters Type Name Description Utf8ByteSpan other Another Utf8ByteSpan. Returns Type Description bool True if the two spans have the same length and the same data, starting from each one's Offset. | Edit this page View Source Equals(string) Tests whether the bytes in this span are the same as the UTF-8 encoding of the specified string. Declaration public bool Equals(string s) Parameters Type Name Description string s A string. Returns Type Description bool True if the bytes are equivalent. Remarks This method is potentially inefficient and should be used only in testing. | Edit this page View Source GetString() Converts the UTF-8 byte data to a string. Declaration public string GetString() Returns Type Description string A new string."
  },
  "api/LaunchDarkly.EventSource.html": {
    "href": "api/LaunchDarkly.EventSource.html",
    "title": "Namespace LaunchDarkly.EventSource | LaunchDarkly EventSource for .NET",
    "summary": "Namespace LaunchDarkly.EventSource Classes CommentReceivedEventArgs Provides data recieved in the EventSource CommentReceived event. Configuration An immutable class containing configuration properties for EventSource. ConfigurationBuilder A standard Builder pattern for constructing a Configuration instance. EventSource Provides an EventSource client for consuming Server-Sent Events. Additional details on the Server-Sent Events spec can be found at https://html.spec.whatwg.org/multipage/server-sent-events.html EventSourceServiceCancelledException General superclass for exceptions that caused the EventSource to disconnect or fail to establish a connection. EventSourceServiceUnsuccessfulResponseException Indicates that the EventSource was able to establish an HTTP connection, but received a non-successful status code. ExceptionEventArgs Provides exception data raised in the EventSource Error event. MessageReceivedEventArgs The parameter type for a MessageReceived event handler. ReadTimeoutException An exception that indicates that the configured read timeout elapsed without receiving any new data from the server. StateChangedEventArgs Provides data for the state of the EventSource connection. Structs MessageEvent Represents the Server-Sent Event message received from a stream. Utf8ByteSpan Points to a span of UTF-8-encoded text in a buffer. Interfaces IEventSource This interface defines the public members of EventSource. Enums ReadyState Represents the state of the connection in the EventSource class."
  },
  "api/LaunchDarkly.Logging.Extensions.html": {
    "href": "api/LaunchDarkly.Logging.Extensions.html",
    "title": "Class Extensions | LaunchDarkly EventSource for .NET",
    "summary": "Class Extensions Inheritance object Extensions Inherited Members object.GetType() object.MemberwiseClone() object.ToString() object.Equals(object) object.Equals(object, object) object.ReferenceEquals(object, object) object.GetHashCode() Namespace: LaunchDarkly.Logging Assembly: LaunchDarkly.Logging.dll Syntax public static class Extensions Methods Uppercase(LogLevel) Declaration public static string Uppercase(this LogLevel level) Parameters Type Name Description LogLevel level Returns Type Description string"
  },
  "api/LaunchDarkly.Logging.IChannel.html": {
    "href": "api/LaunchDarkly.Logging.IChannel.html",
    "title": "Interface IChannel | LaunchDarkly EventSource for .NET",
    "summary": "Interface IChannel Namespace: LaunchDarkly.Logging Assembly: LaunchDarkly.Logging.dll Syntax public interface IChannel Methods IsEnabled(LogLevel) Declaration bool IsEnabled(LogLevel level) Parameters Type Name Description LogLevel level Returns Type Description bool Log(LogLevel, object) Declaration void Log(LogLevel level, object message) Parameters Type Name Description LogLevel level object message Log(LogLevel, string, object) Declaration void Log(LogLevel level, string format, object param) Parameters Type Name Description LogLevel level string format object param Log(LogLevel, string, object, object) Declaration void Log(LogLevel level, string format, object param1, object param2) Parameters Type Name Description LogLevel level string format object param1 object param2 Log(LogLevel, string, params object[]) Declaration void Log(LogLevel level, string format, params object[] allParams) Parameters Type Name Description LogLevel level string format object[] allParams"
  },
  "api/LaunchDarkly.Logging.ILogAdapter.html": {
    "href": "api/LaunchDarkly.Logging.ILogAdapter.html",
    "title": "Interface ILogAdapter | LaunchDarkly EventSource for .NET",
    "summary": "Interface ILogAdapter Namespace: LaunchDarkly.Logging Assembly: LaunchDarkly.Logging.dll Syntax public interface ILogAdapter Methods NewChannel(string) Declaration IChannel NewChannel(string name) Parameters Type Name Description string name Returns Type Description IChannel Extension Methods ILogAdapterExtensions.Level(ILogAdapter, LogLevel) ILogAdapterExtensions.Logger(ILogAdapter, string)"
  },
  "api/LaunchDarkly.Logging.ILogAdapterExtensions.html": {
    "href": "api/LaunchDarkly.Logging.ILogAdapterExtensions.html",
    "title": "Class ILogAdapterExtensions | LaunchDarkly EventSource for .NET",
    "summary": "Class ILogAdapterExtensions Inheritance object ILogAdapterExtensions Inherited Members object.GetType() object.MemberwiseClone() object.ToString() object.Equals(object) object.Equals(object, object) object.ReferenceEquals(object, object) object.GetHashCode() Namespace: LaunchDarkly.Logging Assembly: LaunchDarkly.Logging.dll Syntax public static class ILogAdapterExtensions Methods Level(ILogAdapter, LogLevel) Declaration public static ILogAdapter Level(this ILogAdapter adapter, LogLevel minimumLevel) Parameters Type Name Description ILogAdapter adapter LogLevel minimumLevel Returns Type Description ILogAdapter Logger(ILogAdapter, string) Declaration public static Logger Logger(this ILogAdapter adapter, string name) Parameters Type Name Description ILogAdapter adapter string name Returns Type Description Logger"
  },
  "api/LaunchDarkly.Logging.LogCapture.Message.html": {
    "href": "api/LaunchDarkly.Logging.LogCapture.Message.html",
    "title": "Struct LogCapture.Message | LaunchDarkly EventSource for .NET",
    "summary": "Struct LogCapture.Message Inherited Members ValueType.Equals(object) ValueType.GetHashCode() object.GetType() object.Equals(object, object) object.ReferenceEquals(object, object) Namespace: LaunchDarkly.Logging Assembly: LaunchDarkly.Logging.dll Syntax public struct LogCapture.Message Constructors Message(string, LogLevel, string) Declaration public Message(string loggerName, LogLevel level, string text) Parameters Type Name Description string loggerName LogLevel level string text Properties Level Declaration public LogLevel Level { get; } Property Value Type Description LogLevel LoggerName Declaration public string LoggerName { get; } Property Value Type Description string Text Declaration public string Text { get; } Property Value Type Description string Methods ToString() Declaration public override string ToString() Returns Type Description string Overrides ValueType.ToString()"
  },
  "api/LaunchDarkly.Logging.LogCapture.html": {
    "href": "api/LaunchDarkly.Logging.LogCapture.html",
    "title": "Class LogCapture | LaunchDarkly EventSource for .NET",
    "summary": "Class LogCapture Inheritance object LogCapture Implements ILogAdapter Inherited Members object.GetType() object.MemberwiseClone() object.Equals(object) object.Equals(object, object) object.ReferenceEquals(object, object) object.GetHashCode() Namespace: LaunchDarkly.Logging Assembly: LaunchDarkly.Logging.dll Syntax public class LogCapture : ILogAdapter Constructors LogCapture() Declaration public LogCapture() Methods GetMessageStrings() Declaration public List<string> GetMessageStrings() Returns Type Description List<string> GetMessages() Declaration public List<LogCapture.Message> GetMessages() Returns Type Description List<LogCapture.Message> HasMessageWithRegex(LogLevel, string) Declaration public bool HasMessageWithRegex(LogLevel level, string pattern) Parameters Type Name Description LogLevel level string pattern Returns Type Description bool HasMessageWithText(LogLevel, string) Declaration public bool HasMessageWithText(LogLevel level, string text) Parameters Type Name Description LogLevel level string text Returns Type Description bool NewChannel(string) Declaration public IChannel NewChannel(string name) Parameters Type Name Description string name Returns Type Description IChannel ToString() Declaration public override string ToString() Returns Type Description string Overrides object.ToString() Implements ILogAdapter Extension Methods ILogAdapterExtensions.Level(ILogAdapter, LogLevel) ILogAdapterExtensions.Logger(ILogAdapter, string)"
  },
  "api/LaunchDarkly.Logging.LogLevel.html": {
    "href": "api/LaunchDarkly.Logging.LogLevel.html",
    "title": "Enum LogLevel | LaunchDarkly EventSource for .NET",
    "summary": "Enum LogLevel Namespace: LaunchDarkly.Logging Assembly: LaunchDarkly.Logging.dll Syntax public enum LogLevel Fields Name Description Debug Error Info None Warn Extension Methods Extensions.Uppercase(LogLevel)"
  },
  "api/LaunchDarkly.Logging.LogValues.html": {
    "href": "api/LaunchDarkly.Logging.LogValues.html",
    "title": "Class LogValues | LaunchDarkly EventSource for .NET",
    "summary": "Class LogValues Inheritance object LogValues Inherited Members object.GetType() object.MemberwiseClone() object.ToString() object.Equals(object) object.Equals(object, object) object.ReferenceEquals(object, object) object.GetHashCode() Namespace: LaunchDarkly.Logging Assembly: LaunchDarkly.Logging.dll Syntax public static class LogValues Methods Defer(Func<string>) Declaration public static object Defer(Func<string> stringProvider) Parameters Type Name Description Func<string> stringProvider Returns Type Description object ExceptionSummary(Exception) Declaration public static object ExceptionSummary(Exception e) Parameters Type Name Description Exception e Returns Type Description object ExceptionTrace(Exception) Declaration public static object ExceptionTrace(Exception e) Parameters Type Name Description Exception e Returns Type Description object"
  },
  "api/LaunchDarkly.Logging.Logger.html": {
    "href": "api/LaunchDarkly.Logging.Logger.html",
    "title": "Class Logger | LaunchDarkly EventSource for .NET",
    "summary": "Class Logger Inheritance object Logger Inherited Members object.GetType() object.ToString() object.Equals(object) object.Equals(object, object) object.ReferenceEquals(object, object) object.GetHashCode() Namespace: LaunchDarkly.Logging Assembly: LaunchDarkly.Logging.dll Syntax public sealed class Logger Methods Debug(object) Declaration public void Debug(object message) Parameters Type Name Description object message Debug(string, object) Declaration public void Debug(string format, object param) Parameters Type Name Description string format object param Debug(string, object, object) Declaration public void Debug(string format, object param1, object param2) Parameters Type Name Description string format object param1 object param2 Debug(string, params object[]) Declaration public void Debug(string format, params object[] allParams) Parameters Type Name Description string format object[] allParams Error(object) Declaration public void Error(object message) Parameters Type Name Description object message Error(string, object, object) Declaration public void Error(string format, object param1, object param2) Parameters Type Name Description string format object param1 object param2 Error(string, params object[]) Declaration public void Error(string format, params object[] allParams) Parameters Type Name Description string format object[] allParams Info(object) Declaration public void Info(object message) Parameters Type Name Description object message Info(string, object) Declaration public void Info(string format, object param) Parameters Type Name Description string format object param Info(string, object, object) Declaration public void Info(string format, object param1, object param2) Parameters Type Name Description string format object param1 object param2 Info(string, params object[]) Declaration public void Info(string format, params object[] allParams) Parameters Type Name Description string format object[] allParams IsEnabled(LogLevel) Declaration public bool IsEnabled(LogLevel level) Parameters Type Name Description LogLevel level Returns Type Description bool SubLogger(string) Declaration public Logger SubLogger(string nameSuffix) Parameters Type Name Description string nameSuffix Returns Type Description Logger Warn(object) Declaration public void Warn(object message) Parameters Type Name Description object message Warn(string, object) Declaration public void Warn(string format, object param) Parameters Type Name Description string format object param Warn(string, object, object) Declaration public void Warn(string format, object param1, object param2) Parameters Type Name Description string format object param1 object param2 Warn(string, params object[]) Declaration public void Warn(string format, params object[] allParams) Parameters Type Name Description string format object[] allParams WithAdapter(ILogAdapter, string) Declaration public static Logger WithAdapter(ILogAdapter adapter, string name) Parameters Type Name Description ILogAdapter adapter string name Returns Type Description Logger error(string, object) Declaration public void error(string format, object param) Parameters Type Name Description string format object param"
  },
  "api/LaunchDarkly.Logging.Logs.html": {
    "href": "api/LaunchDarkly.Logging.Logs.html",
    "title": "Class Logs | LaunchDarkly EventSource for .NET",
    "summary": "Class Logs Inheritance object Logs Inherited Members object.GetType() object.MemberwiseClone() object.ToString() object.Equals(object) object.Equals(object, object) object.ReferenceEquals(object, object) object.GetHashCode() Namespace: LaunchDarkly.Logging Assembly: LaunchDarkly.Logging.dll Syntax public static class Logs Properties Default Declaration public static ILogAdapter Default { get; } Property Value Type Description ILogAdapter None Declaration public static ILogAdapter None { get; } Property Value Type Description ILogAdapter ToConsole Declaration public static SimpleLogging ToConsole { get; } Property Value Type Description SimpleLogging Methods Capture() Declaration public static LogCapture Capture() Returns Type Description LogCapture ToMethod(Action<string>) Declaration public static SimpleLogging ToMethod(Action<string> writeLineMethod) Parameters Type Name Description Action<string> writeLineMethod Returns Type Description SimpleLogging ToMultiple(params ILogAdapter[]) Declaration public static ILogAdapter ToMultiple(params ILogAdapter[] logAdapters) Parameters Type Name Description ILogAdapter[] logAdapters Returns Type Description ILogAdapter ToWriter(TextWriter) Declaration public static SimpleLogging ToWriter(TextWriter stream) Parameters Type Name Description TextWriter stream Returns Type Description SimpleLogging"
  },
  "api/LaunchDarkly.Logging.SimpleLogging.html": {
    "href": "api/LaunchDarkly.Logging.SimpleLogging.html",
    "title": "Class SimpleLogging | LaunchDarkly EventSource for .NET",
    "summary": "Class SimpleLogging Inheritance object SimpleLogging Implements ILogAdapter Inherited Members object.GetType() object.MemberwiseClone() object.ToString() object.Equals(object) object.Equals(object, object) object.ReferenceEquals(object, object) object.GetHashCode() Namespace: LaunchDarkly.Logging Assembly: LaunchDarkly.Logging.dll Syntax public class SimpleLogging : ILogAdapter Fields DefaultDateFormat Declaration public const string DefaultDateFormat = \"yyyy-MM-dd HH:mm:ss.fff zzz\" Field Value Type Description string Methods DateFormat(string) Declaration public SimpleLogging DateFormat(string dateFormat) Parameters Type Name Description string dateFormat Returns Type Description SimpleLogging NewChannel(string) Declaration public IChannel NewChannel(string name) Parameters Type Name Description string name Returns Type Description IChannel Implements ILogAdapter Extension Methods ILogAdapterExtensions.Level(ILogAdapter, LogLevel) ILogAdapterExtensions.Logger(ILogAdapter, string)"
  },
  "api/LaunchDarkly.Logging.html": {
    "href": "api/LaunchDarkly.Logging.html",
    "title": "Namespace LaunchDarkly.Logging | LaunchDarkly EventSource for .NET",
    "summary": "Namespace LaunchDarkly.Logging Classes Extensions ILogAdapterExtensions LogCapture LogValues Logger Logs SimpleLogging Structs LogCapture.Message Interfaces IChannel ILogAdapter Enums LogLevel"
  }
}