Skip to content

Releases

Version 5.5.1

Choose a tag to compare

@Marfusios Marfusios released this 24 Sep 14:00
9c3d42b

What's Changed

  • Fixed missing DisconnectionHappened notifications when ClientWebSocket rejects an invalid close frame, such as close status 1100. The client now emits exactly one DisconnectionType.Lost notification with the original WebSocketException, whether automatic reconnection is enabled or disabled. Fixes #160 via #161.
  • Preserved CancelReconnection, normal server-initiated closing, and CancelClosing behavior without duplicate disconnection notifications.
  • Added seven regression cases using real WebSocket connections and raw close frames.
  • Stabilized existing tests: wait for the server greeting before injecting fake messages, and verify the final connection after rapid reconnects without depending on greetings from sockets that were immediately closed.
  • Switched NuGet publishing to Trusted Publishing with short-lived OIDC credentials.

Compatibility and Validation

  • No public API changes or changes to supported target frameworks: .NET Standard 2.0/2.1 and .NET 6/7/8/9/10.
  • All 58 tests passed in GitHub Actions, alongside the .NET Framework 4.7.2 sample and benchmark builds on Windows.
  • Local Release solution build completed with zero warnings or errors. The corrected rapid-reconnect test also passed ten consecutive runs.
  • Websocket.Client 5.5.1 is available on NuGet. The downloaded package's NuGet.org repository signature was verified with dotnet nuget verify --all.

Full changelog: v5.5...v5.5.1

Version 5.5

Choose a tag to compare

@Marfusios Marfusios released this 19 May 12:15
58767e1

What's Changed

  • Added a netstandard2.0 target so full .NET Framework applications can consume Websocket.Client again.
  • Kept the existing .NET 6/7/8/9/10 paths on the current Memory<byte>/ReadOnlyMemory<byte> WebSocket APIs, with compatibility fallbacks isolated to netstandard2.0.
  • Modernized the .NET Framework sample to SDK-style net472 with PackageReference dependencies and current Websocket.Client API usage.
  • Added Windows CI coverage for the .NET Framework sample and net472 benchmark 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.0 package asset.
  • No breaking API changes for existing .NET Core / modern .NET targets.

Version 5.4

Choose a tag to compare

@Marfusios Marfusios released this 13 May 11:06
298b5ce

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 B to 29.65 ns / 0 B per 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

Choose a tag to compare

@Marfusios Marfusios released this 15 Feb 15:57
fb57ec5

Features

  • Usage of RecyclableMemoryStream for processing incoming messages. Thanks @Odonno !
  • The new methods available
    • SendAsText(byte[] | ArraySegment<byte>) - send binary message as Text type. Use it to avoid double serialization.

Version 5.0

Choose a tag to compare

@Marfusios Marfusios released this 07 Sep 09:31
ca291cb

Breaking changes

  • removed LibLog in favor of Microsoft.Extensions.Logging. You need to provide ILogger instance in the constructor parameter.
  • library no longer targeting netstandard2.0 and net5

Features

  • nullable reference types enabled, you should now get a better info on what can be null

Version 4.0

Choose a tag to compare

@Marfusios Marfusios released this 05 Dec 16:00
06c9d90

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

Choose a tag to compare

@Marfusios Marfusios released this 12 Mar 11:59
2cc8803

Breaking changes

  • return type of MessageReceived observable was changed from string to ResponseMessage

Features

  • support for binary messages
    • a new method Send() and SendInstant() with parameter byte[]
    • MessageReceived observable now streams text or binary data (there is type property to distinguish between them)
  • a new MessageEncoding property to change encoding of sent/received text messages (default is UTF8)

Version 2.0

Choose a tag to compare

@Marfusios Marfusios released this 04 Feb 18:03
52179eb

Breaking changes

  • dependency to Serilog was removed, switched to logging abstraction (LibLog)

Features

  • a new Name property to distinguish between websocket clients in the logs
⌂ 换网址