Releases: Marfusios/websocket-client
Releases · Marfusios/websocket-client
Version 5.5
What's Changed
- Added a
netstandard2.0target so full .NET Framework applications can consumeWebsocket.Clientagain. - Kept the existing .NET 6/7/8/9/10 paths on the current
Memory<byte>/ReadOnlyMemory<byte>WebSocket APIs, with compatibility fallbacks isolated tonetstandard2.0. - Modernized the .NET Framework sample to SDK-style
net472withPackageReferencedependencies and current Websocket.Client API usage. - Added Windows CI coverage for the .NET Framework sample and
net472benchmark build. - Added .NET Framework client receive benchmark coverage and documented the measured results.
Compatibility
- NuGet package version:
5.5.0. - Adds support for full .NET Framework consumers through the
netstandard2.0package asset. - No breaking API changes for existing .NET Core / modern .NET targets.
Version 5.4
Highlights
- Published Websocket.Client 5.4.0 to NuGet.
- Added .NET 9 and .NET 10 targets while keeping the existing supported target frameworks for backward compatibility.
- Added a BenchmarkDotNet project and documented benchmark results in
benchmarks/README.md. - Updated the main README with a high-level performance overview for the library.
Performance
- Optimized receive processing to reduce allocations with pooled buffers and lower-copy message construction.
- Reduced queued send request overhead by replacing internal request wrapper allocations with a value-type envelope.
- Added send framing, receive buffering, text encoding, response message, observable property, and logging benchmarks to make future performance changes measurable.
- Current queued send benchmark improved from
31.54 ns / 24 Bto29.65 ns / 0 Bper operation.
Compatibility and Reliability
- Added
ReadOnlySequence<byte>send support and tests for binary-as-text send overload behavior. - Added support for reusing an external
RecyclableMemoryStreamManager. - Fixed reconnect logic and increased the default connect timeout to 5 seconds.
- Conditionalized dependencies for cleaner target-framework-specific package output.
Notes
- No intentional public contract breaks.
- CI now builds with the .NET 10 SDK and the release pipeline passed for this version.
Version 5.1
Features
- Usage of RecyclableMemoryStream for processing incoming messages. Thanks @Odonno !
- The new methods available
SendAsText(byte[] | ArraySegment<byte>)- send binary message asTexttype. Use it to avoid double serialization.
Version 5.0
Breaking changes
- removed
LibLogin favor ofMicrosoft.Extensions.Logging. You need to provideILoggerinstance in the constructor parameter. - library no longer targeting
netstandard2.0andnet5
Features
nullable reference typesenabled, you should now get a better info on what can be null
Version 4.0
Breaking changes
- timeout properties changed from milliseconds (int) to
TimeSpan - DisconnectionHappened, ReconnectionHappened streams now return complex info object instead of enum
- changed return type from Task to void in Send() methods (sending is done through the queue)
Features
- ability to disable last chance reconnection (when no message comes from server for predefined time) -
ReconnectTimeout = null - streaming fake messages - to mimic server response -
StreamFakeMessage(...) - fail fast for starting, stopping and manual reconnection - throws an exception when the initial connection fails -
StartOrFail(),ReconnectOrFail(),StopOrFail() - more info in DisconnectionHappened stream - close status, exception that caused disconnection, etc.
- runtime reconnection canceling from DisconnectionHappened stream - it will stop ongoing reconnection -
disconnectionInfo.CancelReconnection = true - normal closure - automatically Close client when server sends Close message, could be disabled by DisconnectionHappened stream -
disconnectionInfo.CancelClosing= true - performance optimizations
- sending is done through Channels
- listening now allocates less memory and handles differently single chunk vs multi chunks
Version 3.0
Breaking changes
- return type of
MessageReceivedobservable was changed from string toResponseMessage
Features
- support for binary messages
- a new method
Send()andSendInstant()with parameterbyte[] MessageReceivedobservable now streams text or binary data (there is type property to distinguish between them)
- a new method
- a new
MessageEncodingproperty to change encoding of sent/received text messages (default is UTF8)
Version 2.0
Breaking changes
- dependency to Serilog was removed, switched to logging abstraction (LibLog)
Features
- a new
Nameproperty to distinguish between websocket clients in the logs