Skip to content

Releases: SlickQuant/slick-net

Release v3.0.0

18 Jun 01:12

Choose a tag to compare

Changes

Added

  • Websocket<BufferT> is now a class template parameterized on the read-buffer
    type. Default is boost::beast::flat_buffer, and the library explicitly
    instantiates the supported slick stream-buffer backends.
  • New constructor overload accepting a std::shared_ptr<BackendT>:
    Websocket<slick::dynamic_buffer<slick::stream_buffer>> ws(url, callbacks..., sb);
    Websocket<slick::dynamic_buffer<producer_buffer>>      ws(url, callbacks..., pb);
    This allows slick::dynamic_buffer<stream_buffer> and
    slick::dynamic_buffer<stream_buffer_multiplexer::producer_buffer> as read-buffer
    backends for lock-free zero-copy streaming while keeping application code on the
    public <slick/net/websocket.hpp> include.
  • Shared-backend reconnect: for slick dynamic-buffer types the same backend is
    reused across open() cycles — records from all sessions accumulate in the ring.
    For flat_buffer each reconnect starts a fresh buffer.
  • slick_buffer_tests — new test binary exercising the stream_buffer and
    producer_buffer paths end-to-end (construction, data round-trip, reconnect).
  • Additional same-object reconnect tests covering deferred reconnect while
    disconnecting, rapid reconnect buffer handoff, and cancellation of a pending
    deferred open.
  • Custom buffer types can opt into template definitions by defining
    SLICK_NET_WEBSOCKET_HEADER_ONLY before including <slick/net/websocket.hpp>.
  • websocket_with_custom_buffer_example demonstrates the custom-buffer opt-in path.

Changed

  • BREAKING: Websocket::reset_callbacks() was replaced by Websocket::detach().
  • Websocket::open() now defers a same-object reconnect until the previous
    session's read loop releases the shared backend (shared-buffer path only;
    flat_buffer starts immediately).
  • Websocket::close() can now cancel a pending deferred open() before the new
    session starts.
  • Websocket::send() and Websocket::send_binary_data() now accept an optional
    suppress_log flag.
  • GoogleTest discovery now runs in PRE_TEST mode to avoid slow first-launch
    failures during the build step.

Fixed

  • Rapid same-object reconnect no longer allows overlapping producers to touch the
    shared read buffer.
  • Detached or superseded WebSocket sessions now suppress stale error and disconnect
    callbacks during teardown.
  • Partial read data from an interrupted session is discarded before the next session
    starts reading on the shared buffer.
  • Queued sends made while a connection is still handshaking no longer repost
    writes in a tight loop before the socket reaches CONNECTED.
  • URL parsing now handles normal short host:port forms such as abc:9000
    instead of treating the colon as part of the host.

Release v2.1.0

04 Jun 19:13

Choose a tag to compare

Changes

Added

  • Same-object WebSocket reconnect: Websocket::open() can now be called again on the same object after a disconnect, without creating a new instance. Each call to open() on a DISCONNECTED websocket creates a fresh internal session (new TCP stream, SSL context, read/write buffers) while reusing the original URL and callbacks.
    • Safe to call from within any callback (onConnected, onDisconnected, onData, onError) — the new connection is posted asynchronously and does not block the service thread.
    • If called while the previous session is still DISCONNECTING (rapid reconnect), the outgoing close completes in the background but its onDisconnected callback is suppressed, so only the new session's events reach the caller.

Changed

  • Websocket constructor defers Impl creation to open(). URL and callbacks are now stored on the outer Websocket object so they survive across reconnect cycles.
  • Websocket::Impl constructor parameters changed from rvalue references to by-value to support passing copies of stored callbacks on each open().
  • All Websocket public methods (close(), send(), send_binary_data(), status(), reset_callbacks()) now guard against a null impl_ (the state before the first open() call). send() before open() logs a warning and drops the message instead of crashing.
  • Several tests that unnecessarily heap-allocated Websocket via make_shared simplified to stack-allocated instances.
  • LINK_STATICALLY cmake option is now available on all platforms, not just MSVC.
    • Windows: sets VCPKG_TARGET_TRIPLET to x64-windows-static.
    • macOS: sets VCPKG_TARGET_TRIPLET to arm64-osx-static or x64-osx-static based on architecture.
    • Linux: no triplet change needed — x64-linux is already static by default.
  • OPENSSL_MSVC_STATIC_RT is now only set on MSVC (was incorrectly set on all platforms when LINK_STATICALLY was on).
  • Non-MSVC release builds skip -march=native when cross-compiling.

Tests

  • Added 9 same-object reconnect tests, each pairing an existing new-object test:
    • Reconnect_AfterGracefulClose_Connects — basic reconnect after clean close
    • Reconnect_MultipleConsecutiveCycles_AllConnect — 3 reconnect cycles with echo verification
    • Reconnect_FromWithinDisconnectCallback_Connects — reconnect from inside onDisconnected
    • Reconnect_FromWithinErrorCallback_Connects — reconnect from inside onError
    • Reconnect_AfterDisconnectInDataCallback_Connects — reconnect after close() called from onData
    • Reconnect_AfterServerSideClose_Connects — reconnect after close() called from onConnected
    • Reconnect_SameObject_DataIntegrity_NoBleedBetweenSessions — no stale data across sessions
    • Reconnect_SameObject_RapidSuccessiveCycles_ServiceThreadRemainsFunctional — 5 rapid close/open cycles, write pipeline verified on final session
    • Reconnect_SameObject_CallbacksFireInCorrectOrderconnected → data → disconnected ordering verified across 3 sessions

Documentation

  • open() declaration in websocket.hpp annotated with reconnect semantics, the DISCONNECTING suppression behavior, and callback-safety guarantee.
  • README: new Reconnect section under the Websocket API with a code example and an ASCII diagram illustrating when onDisconnected fires versus is suppressed in the rapid-reconnect edge case.

Release v2.0.3

07 May 12:54

Choose a tag to compare

Changes

Added

  • Websocket::reset_callbacks() — public API to silence all callbacks (sets each to a no-op), useful when the caller wants to tear down a Websocket without receiving further events.

Fixed

  • Websocket destructor now explicitly calls reset_callbacks() followed by close() instead of defaulting, preventing spurious callbacks from firing into already-destroyed caller state during object destruction.

Release v2.0.2

04 May 10:52

Choose a tag to compare

Changes

Added

  • Added reason in Http::Response

Fixed

  • HTTP response body is now always returned in result_text regardless of status code. Previously, non-2xx responses (e.g. 400 Bad Request) set result_text to the HTTP reason phrase instead of the response body, discarding any JSON error payload sent by the server.

Release v2.0.1

30 Apr 08:11

Choose a tag to compare

Changes

Chaged

  • Updated SSE endpoint in excamples and tests
  • Added timeout handling in HTTP stream sessions

Fixed

  • WebSocket co_spawn completion handler now guards on_error_() with a run_ check, suppressing spurious error callbacks after shutdown.
  • Fixed use-after-free in WebSocket tests where [&] lambda captures referenced destroyed stack variables when async callbacks fired via IOCP after the test function returned. Affected tests (ConnectToEchoServer, InvalidHostnameError, MultipleErrorCallbacks, ReconnectAfterError, PlainWebsocket_UrlParsing) now use shared_ptr captures to extend captured variable lifetimes.
  • normalize CRLF in SSE chunk parsing

Tests

  • Added 10 comprehensive Reconnect_* tests verifying correct behavior when reconnecting by creating a new Websocket instance during normal operation (service thread always running):
    • Graceful close → new-object reconnect
    • Three consecutive reconnect cycles with data verification
    • Reconnect initiated from within on_disconnected_ callback (deadlock check)
    • Reconnect initiated from within on_error_ callback
    • Reconnect after closing from within on_data_ callback
    • Reconnect after simulated server-side close
    • Cross-session data integrity (no bleed via shared io_context/SSL context)
    • Rapid successive cycles (service thread stability)
    • Callback ordering across sessions (connecteddatadisconnected)
    • Concurrent dual-instance connect (shared SSL context)

Release v2.0.0

15 Feb 09:48

Choose a tag to compare

Changes

Changed

  • BREAKING: Switched slick::net from header-only to static-library
    • Normalized header files to .hpp
    • Separated HttpStream to its own header http_stream.hpp
    • Added compiled sources under src/ (http_stream.cpp, http.cpp, websocket.cpp, websocket_session.cpp, logging.cpp)
    • Reduced downstream compile-time pressure by moving heavy Boost/OpenSSL implementation out of public headers
    • Websocket is nolonger derived from std::enabled_shared_from_this
  • Added PIMPL-based slim public headers for Websocket
  • Added runtime logging hook API in include/slick/net/logging.hpp
    • set_log_handler(LogHandler)
    • clear_log_handler()
  • Added logging_tests for runtime logging hook dispatch behavior

Release v1.2.4

08 Feb 22:17

Choose a tag to compare

Changes

Fixed

  • WebSocket error handling now properly ignores SSL stream_truncated errors
    • Added ssl::error::stream_truncated to the list of benign errors in read/write/close handlers
    • Prevents spurious error callbacks when SSL connections are closed without proper shutdown handshake
    • Improved code formatting for better readability of error condition checks
  • WebSocket read handler now uses memory_order_release when setting DISCONNECTED state for proper memory synchronization

Changed

  • Removed INTERFACE precompiled headers to improve downstream project build times
    • Downstream projects are no longer forced to precompile Boost.Beast/Asio and OpenSSL headers
    • Projects can now opt-in to their own PCH strategy if desired
    • Library functionality remains unchanged

Release v1.2.3

29 Jan 17:37

Choose a tag to compare

Changes

Fixed

  • WebSocket open now rejects DISCONNECTING state to avoid overlapping reconnect/close races.
  • WebSocket handshake no longer mutates the stored host with an appended port, preventing host corruption on reconnect.
  • WebSocket write errors are now surfaced while connected instead of being ignored.
  • Async HTTP request accounting now decrements even when the coroutine fails, allowing the service thread to stop.

Changed

  • Updated slick-net-config.cmake.in file to remove cmake config warning.

Release v1.2.2

14 Jan 03:53

Choose a tag to compare

Changes

  • Upgraded to slick-queue v1.2.2
  • Renamed repository from slick_net to slick-net (hyphenated naming follows recommended convention)
  • Changed export name from slick_net, slick::slick_net to slick::net
  • Refactored repository name in CMake configuration files
  • Updated documentation and build references to use new repository name
  • Added release GitHub Workflow
  • Updated license copyright years
  • Improved Websocket unittest

v1.2.1

25 Nov 17:02

Choose a tag to compare

New Features

  • vcpkg Package Manager Support: Full integration with vcpkg for easy installation and dependency management
    • Created CMake config files for proper package discovery
    • Ready for submission to official vcpkg registry

Improvements

  • WebSocket Message Queueing: Enhanced send() method to properly queue messages sent immediately after open()
    • Messages are now queued during CONNECTING state and sent after connection is established
    • Ensures messages sent right after open() are not lost and are delivered in order
    • Updated status check to allow queueing during both DISCONNECTED and CONNECTING states

Testing

  • Added comprehensive WebSocket unit tests for send-after-open scenarios:
    • SendImmediatelyAfterOpen_MessageQueuedAndSentAfterConnect - Single message test
    • SendImmediatelyAfterOpen_MultipleMessages - Multiple messages queuing test
    • SendImmediatelyAfterOpen_VerifyOrderPreserved - Message ordering verification
    • SendImmediatelyAfterOpen_LargeMessage - Large message (5KB) queueing test

Build System

  • Added CMake installation rules for proper package export
  • Created slick_net-config.cmake.in template for downstream projects
  • Added version compatibility checking (SameMajorVersion policy)
  • Improved CMake target exports with proper namespace (slick::slick_net)

CI/CD

  • Updated GitHub Actions CI to use GCC 14 on Linux for full C++20 coroutine support
  • Removed GCC 13 compatibility workarounds for awaitable HTTP tests