Websocket.Client
Custom exception that indicates bad user/client input
Custom exception related to WebsocketClient
A simple websocket client with built-in reconnection and error handling
Get or set target websocket url
Stream with received message (raw format)
Stream for reconnection event (triggered after the new connection)
Stream for disconnection event (triggered after the connection was lost)
Time range in ms, how long to wait before reconnecting if no message comes from server.
Set null to disable this feature.
Default: 1 minute.
Time range in ms, how long to wait before reconnecting if last reconnection failed.
Set null to disable this feature.
Default: 1 minute.
Get or set the name of the current websocket client instance.
For logging purpose (in case you use more parallel websocket clients and want to distinguish between them)
Returns true if Start() method was called at least once. False if not started or disposed
Returns true if client is running and connected to the server
Enable or disable reconnection functionality (enabled by default)
Enable or disable text message conversion from binary to string (via 'MessageEncoding' property).
Default: true
Returns currently used native websocket client.
Use with caution, on every reconnection there will be a new instance.
Sets used encoding for sending and receiving text messages.
Default: UTF8
Start listening to the websocket stream on the background thread.
In case of connection error it doesn't throw an exception.
Only streams a message via 'DisconnectionHappened' and logs it.
Start listening to the websocket stream on the background thread.
In case of connection error it throws an exception.
Fail fast approach.
Stop/close websocket connection with custom close code.
Method doesn't throw exception, only logs it and mark client as closed.
Returns true if close was initiated successfully
Stop/close websocket connection with custom close code.
Method could throw exceptions, but client is marked as closed anyway.
Returns true if close was initiated successfully
Send message to the websocket channel.
It inserts the message to the queue and actual sending is done on an other thread
Message to be sent
Send binary message to the websocket channel.
It inserts the message to the queue and actual sending is done on an other thread
Binary message to be sent
Send binary message to the websocket channel.
It inserts the message to the queue and actual sending is done on an other thread
Binary message to be sent
Send message to the websocket channel.
It doesn't use a sending queue,
beware of issue while sending two messages in the exact same time
on the full .NET Framework platform
Message to be sent
Send binary message to the websocket channel.
It doesn't use a sending queue,
beware of issue while sending two messages in the exact same time
on the full .NET Framework platform
Message to be sent
Force reconnection.
Closes current websocket stream and perform a new connection to the server.
In case of connection error it doesn't throw an exception, but tries to reconnect indefinitely.
Force reconnection.
Closes current websocket stream and perform a new connection to the server.
In case of connection error it throws an exception and doesn't perform any other reconnection try.
Stream/publish fake message (via 'MessageReceived' observable).
Use for testing purposes to simulate a server message.
Message to be stream
Info about happened disconnection
Disconnection reason
Indicates the reason why the remote endpoint initiated the close handshake
Allows the remote endpoint to describe the reason why the connection was closed
The subprotocol that was negotiated during the opening handshake
Exception that cause disconnection, can be null
Set to true if you want to cancel ongoing reconnection
Set to true if you want to cancel ongoing connection close (only when Type = ByServer)
Simple factory method
Type that specify happened disconnection
Type used for exit event, disposing of the websocket client
Type used when connection to websocket was lost in meantime
Type used when connection to websocket was lost by not receiving any message in given time-range
Type used when connection or reconnection returned error
Type used when disconnection was requested by user
Type used when disconnection was requested by server
Info about happened reconnection
Reconnection reason
Simple factory method
Type that specify happened reconnection
Type used for initial connection to websocket stream
Type used when connection to websocket was lost in meantime
Type used when connection to websocket was lost by not receiving any message in given time-range
Type used after unsuccessful previous reconnection
Type used when reconnection was requested by user
Type used when reconnection was requested by server
Received message, could be Text or Binary
Received text message (only if type = WebSocketMessageType.Text)
Received text message (only if type = WebSocketMessageType.Binary)
Current message type (Text or Binary)
Return string info about the message
Create text response message
Create binary response message
Class that wraps SemaphoreSlim and enables to use locking inside 'using' blocks easily
Don't need to bother with releasing and handling SemaphoreSlim correctly
Example:
using(await _asyncLock.LockAsync())
{
// do your synchronized work
}
Class that wraps SemaphoreSlim and enables to use locking inside 'using' blocks easily
Don't need to bother with releasing and handling SemaphoreSlim correctly
Use inside 'using' block
Use inside 'using' block with await
It throws if value is null or empty/white spaces
The value to be validated
Input parameter name
It throws if value is null
The value to be validated
Input parameter name
It throws if collection is null or collection is empty
The collection to be validated
Input parameter name
It throws if value is not in specified range
The value to be validated
Input parameter name
Minimal value of input
Maximum value of input
It throws if value is not in specified range
The value to be validated
Input parameter name
Minimal value of input
Maximum value of input
It throws if value is not in specified range
The value to be validated
Input parameter name
Minimal value of input
Maximum value of input
A simple websocket client with built-in reconnection and error handling
A simple websocket client with built-in reconnection and error handling
Target websocket url (wss://)
Optional factory for native ClientWebSocket, use it whenever you need some custom features (proxy, settings, etc)
A simple websocket client with built-in reconnection and error handling
Target websocket url (wss://)
Optional factory for native creating and connecting to a websocket. The method should return a which is connected. Use it whenever you need some custom features (proxy, settings, etc)
Stream with received message (raw format)
Stream for reconnection event (triggered after the new connection)
Stream for disconnection event (triggered after the connection was lost)
Time range in ms, how long to wait before reconnecting if no message comes from server.
Set null to disable this feature.
Default: 1 minute
Time range in ms, how long to wait before reconnecting if last reconnection failed.
Set null to disable this feature.
Default: 1 minute
Enable or disable reconnection functionality (enabled by default)
Get or set the name of the current websocket client instance.
For logging purpose (in case you use more parallel websocket clients and want to distinguish between them)
Returns true if Start() method was called at least once. False if not started or disposed
Returns true if client is running and connected to the server
Enable or disable text message conversion from binary to string (via 'MessageEncoding' property).
Default: true
Terminate the websocket connection and cleanup everything
Start listening to the websocket stream on the background thread.
In case of connection error it doesn't throw an exception.
Only streams a message via 'DisconnectionHappened' and logs it.
Start listening to the websocket stream on the background thread.
In case of connection error it throws an exception.
Fail fast approach.
Stop/close websocket connection with custom close code.
Method doesn't throw exception, only logs it and mark client as closed.
Returns true if close was initiated successfully
Stop/close websocket connection with custom close code.
Method could throw exceptions, but client is marked as closed anyway.
Returns true if close was initiated successfully
Force reconnection.
Closes current websocket stream and perform a new connection to the server.
In case of connection error it doesn't throw an exception, but tries to reconnect indefinitely.
Force reconnection.
Closes current websocket stream and perform a new connection to the server.
In case of connection error it throws an exception and doesn't perform any other reconnection try.
Send text message to the websocket channel.
It inserts the message to the queue and actual sending is done on an other thread
Text message to be sent
Send binary message to the websocket channel.
It inserts the message to the queue and actual sending is done on an other thread
Binary message to be sent
Send binary message to the websocket channel.
It inserts the message to the queue and actual sending is done on an other thread
Binary message to be sent
Send text message to the websocket channel.
It doesn't use a sending queue,
beware of issue while sending two messages in the exact same time
on the full .NET Framework platform
Message to be sent
Send binary message to the websocket channel.
It doesn't use a sending queue,
beware of issue while sending two messages in the exact same time
on the full .NET Framework platform
Message to be sent
Stream/publish fake message (via 'MessageReceived' observable).
Use for testing purposes to simulate a server message.
Message to be stream
Simple interface that represent a logger.
Log a message the specified log level.
The log level.
The message function.
An optional exception.
Optional format parameters for the message generated by the messagefunc.
true if the message was logged. Otherwise false.
Note to implementers: the message func should not be called if the loglevel is not enabled
so as not to incur performance penalties.
To check IsEnabled call Log with only LogLevel and check the return value, no event will be written.
Represents a way to get a
Gets the specified named logger.
Name of the logger.
The logger reference.
Opens a nested diagnostics context. Not supported in EntLib logging.
The message to add to the diagnostics context.
A disposable that when disposed removes the message from the context.
Opens a mapped diagnostics context. Not supported in EntLib logging.
A key.
A value.
Determines whether to call the destructor or not.
A disposable that when disposed removes the map from the context.
Extension methods for the interface.
Check if the log level is enabled.
The to check with.
True if the log level is enabled; false otherwise.
Check if the log level is enabled.
The to check with.
True if the log level is enabled; false otherwise.
Check if the log level is enabled.
The to check with.
True if the log level is enabled; false otherwise.
Check if the log level is enabled.
The to check with.
True if the log level is enabled; false otherwise.
Check if the log level is enabled.
The to check with.
True if the log level is enabled; false otherwise.
Check if the log level is enabled.
The to check with.
True if the log level is enabled; false otherwise.
Logs a message at the log level, if enabled.
The to use.
The message function.
Logs a message at the log level, if enabled.
The to use.
The message.
Logs a message at the log level, if enabled.
The to use.
The message.
Optional format parameters for the message.
Logs an exception at the log level, if enabled.
The to use.
The exception.
The message.
Optional format parameters for the message.
Logs a message at the log level, if enabled.
The to use.
The message.
Optional format parameters for the message.
Logs an exception at the log level, if enabled.
The to use.
The message.
The exception.
Logs an exception at the log level, if enabled.
The to use.
The message.
The exception.
Optional format parameters for the message.
Logs a message at the log level, if enabled.
The to use.
The message function.
Logs a message at the log level, if enabled.
The to use.
The message.
Logs a message at the log level, if enabled.
The to use.
The message.
Optional format parameters for the message.
Logs an exception at the log level, if enabled.
The to use.
The exception.
The message.
Optional format parameters for the message.
Logs a message at the log level, if enabled.
The to use.
The message.
Optional format parameters for the message.
Logs an exception at the log level, if enabled.
The to use.
The message.
The exception.
Optional format parameters for the message.
Logs a message at the log level, if enabled.
The to use.
The message function.
Logs a message at the log level, if enabled.
The to use.
The message.
Logs a message at the log level, if enabled.
The to use.
The message.
Optional format parameters for the message.
Logs an exception at the log level, if enabled.
The to use.
The exception.
The message.
Optional format parameters for the message.
Logs a message at the log level, if enabled.
The to use.
The message.
Optional format parameters for the message.
Logs an exception at the log level, if enabled.
The to use.
The message.
The exception.
Optional format parameters for the message.
Logs a message at the log level, if enabled.
The to use.
The message function.
Logs a message at the log level, if enabled.
The to use.
The message.
Logs a message at the log level, if enabled.
The to use.
The message.
Optional format parameters for the message.
Logs an exception at the log level, if enabled.
The to use.
The exception.
The message.
Optional format parameters for the message.
Logs a message at the log level, if enabled.
The to use.
The message.
Optional format parameters for the message.
Logs an exception at the log level, if enabled.
The to use.
The message.
The exception.
Optional format parameters for the message.
Logs a message at the log level, if enabled.
The to use.
The message function.
Logs a message at the log level, if enabled.
The to use.
The message.
Logs a message at the log level, if enabled.
The to use.
The message.
Optional format parameters for the message.
Logs an exception at the log level, if enabled.
The to use.
The exception.
The message.
Optional format parameters for the message.
Logs a message at the log level, if enabled.
The to use.
The message.
Optional format parameters for the message.
Logs an exception at the log level, if enabled.
The to use.
The message.
The exception.
Optional format parameters for the message.
Logs a message at the log level, if enabled.
The to use.
The message function.
Logs a message at the log level, if enabled.
The to use.
The message.
Logs a message at the log level, if enabled.
The to use.
The message.
Optional format parameters for the message.
Logs an exception at the log level, if enabled.
The to use.
The exception.
The message.
Optional format parameters for the message.
Logs a message at the log level, if enabled.
The to use.
The message.
Optional format parameters for the message.
Logs an exception at the log level, if enabled.
The to use.
The message.
The exception.
Optional format parameters for the message.
The log level.
Trace
Debug
Info
Warn
Error
Fatal
Provides a mechanism to set the .
Sets the current log provider.
The log provider.
Gets or sets a value indicating whether this is logging is disabled.
true if logging is disabled; otherwise, false.
Sets an action that is invoked when a consumer of your library has called SetCurrentLogProvider. It is
important that hook into this if you are using child libraries (especially ilmerged ones) that are using
LibLog (or other logging abstraction) so you adapt and delegate to them.
Gets a logger for the specified type.
The type whose name will be used for the logger.
An instance of
Gets a logger for the current class.
An instance of
Gets a logger for the specified type.
The type whose name will be used for the logger.
If the type is null then this name will be used as the log name instead
An instance of
Gets a logger with the specified name.
The name.
An instance of
Opens a nested diagnostics context.
A message.
An that closes context when disposed.
Opens a mapped diagnostics context.
A key.
A value.
A optional paramater to indicate message should be destructured.
An that closes context when disposed.
Exception thrown by LibLog.
Initializes a new LibLogException with the specified message.
The message
Initializes a new LibLogException with the specified message and inner exception.
The message.
The inner exception.
Some logging frameworks support structured logging, such as serilog. This will allow you to add names to structured
data in a format string:
For example: Log("Log message to {user}", user). This only works with serilog, but as the user of LibLog, you don't
know if serilog is actually
used. So, this class simulates that. it will replace any text in {curly braces} with an index number.
"Log {message} to {user}" would turn into => "Log {0} to {1}". Then the format parameters are handled using regular
.net string.Format.
The message builder.
The format parameters.
Base class for specific log providers.
Error message should initializing the log provider fail.
Initialize an instance of the class by initializing the references
to the nested and mapped diagnostics context-obtaining functions.
Gets the specified named logger.
Name of the logger.
The logger reference.
Opens a nested diagnostics context. Not supported in EntLib logging.
The message to add to the diagnostics context.
A disposable that when disposed removes the message from the context.
Opens a mapped diagnostics context. Not supported in EntLib logging.
A key.
A value.
Determines whether to call the destructor or not.
A disposable that when disposed removes the map from the context.
Returns the provider-specific method to open a nested diagnostics context.
A provider-specific method to open a nested diagnostics context.
Returns the provider-specific method to open a mapped diagnostics context.
A provider-specific method to open a mapped diagnostics context.
Delegate defining the signature of the method opening a nested diagnostics context.
The message to add to the diagnostics context.
A disposable that when disposed removes the message from the context.
Delegate defining the signature of the method opening a mapped diagnostics context.
A key.
A value.
Determines whether to call the destructor or not.
A disposable that when disposed removes the map from the context.
Finds a type using a type name and assembly name.
The name of the type.
The name of the assembly.
The requested type or null if it was not found.
Finds a type using a type name and a list of assembly names to search.
The name of the type.
A list of assembly names to search.
The request type or null if it was not found.
The form of the Loupe Log.Write method we're using
Gets or sets a value indicating whether [provider is available override]. Used in tests.
true if [provider is available override]; otherwise, false.
Logger delegate.
The log level
The message function
The exception
The format parameters
A boolean.