Releases: SlickQuant/slick-net
Releases · SlickQuant/slick-net
Release v3.0.0
Changes
Added
Websocket<BufferT>is now a class template parameterized on the read-buffer
type. Default isboost::beast::flat_buffer, and the library explicitly
instantiates the supported slick stream-buffer backends.- New constructor overload accepting a
std::shared_ptr<BackendT>:This allowsWebsocket<slick::dynamic_buffer<slick::stream_buffer>> ws(url, callbacks..., sb); Websocket<slick::dynamic_buffer<producer_buffer>> ws(url, callbacks..., pb);
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 acrossopen()cycles — records from all sessions accumulate in the ring.
Forflat_buffereach reconnect starts a fresh buffer. slick_buffer_tests— new test binary exercising thestream_bufferand
producer_bufferpaths 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_ONLYbefore including<slick/net/websocket.hpp>. websocket_with_custom_buffer_exampledemonstrates the custom-buffer opt-in path.
Changed
- BREAKING:
Websocket::reset_callbacks()was replaced byWebsocket::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_bufferstarts immediately).Websocket::close()can now cancel a pending deferredopen()before the new
session starts.Websocket::send()andWebsocket::send_binary_data()now accept an optional
suppress_logflag.- GoogleTest discovery now runs in
PRE_TESTmode 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 reachesCONNECTED. - URL parsing now handles normal short
host:portforms such asabc:9000
instead of treating the colon as part of the host.
Release v2.1.0
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 toopen()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
onDisconnectedcallback is suppressed, so only the new session's events reach the caller.
- Safe to call from within any callback (
Changed
Websocketconstructor defersImplcreation toopen(). URL and callbacks are now stored on the outerWebsocketobject so they survive across reconnect cycles.Websocket::Implconstructor parameters changed from rvalue references to by-value to support passing copies of stored callbacks on eachopen().- All
Websocketpublic methods (close(),send(),send_binary_data(),status(),reset_callbacks()) now guard against a nullimpl_(the state before the firstopen()call).send()beforeopen()logs a warning and drops the message instead of crashing. - Several tests that unnecessarily heap-allocated
Websocketviamake_sharedsimplified to stack-allocated instances. LINK_STATICALLYcmake option is now available on all platforms, not just MSVC.- Windows: sets
VCPKG_TARGET_TRIPLETtox64-windows-static. - macOS: sets
VCPKG_TARGET_TRIPLETtoarm64-osx-staticorx64-osx-staticbased on architecture. - Linux: no triplet change needed —
x64-linuxis already static by default.
- Windows: sets
OPENSSL_MSVC_STATIC_RTis now only set on MSVC (was incorrectly set on all platforms whenLINK_STATICALLYwas on).- Non-MSVC release builds skip
-march=nativewhen cross-compiling.
Tests
- Added 9 same-object reconnect tests, each pairing an existing new-object test:
Reconnect_AfterGracefulClose_Connects— basic reconnect after clean closeReconnect_MultipleConsecutiveCycles_AllConnect— 3 reconnect cycles with echo verificationReconnect_FromWithinDisconnectCallback_Connects— reconnect from insideonDisconnectedReconnect_FromWithinErrorCallback_Connects— reconnect from insideonErrorReconnect_AfterDisconnectInDataCallback_Connects— reconnect afterclose()called fromonDataReconnect_AfterServerSideClose_Connects— reconnect afterclose()called fromonConnectedReconnect_SameObject_DataIntegrity_NoBleedBetweenSessions— no stale data across sessionsReconnect_SameObject_RapidSuccessiveCycles_ServiceThreadRemainsFunctional— 5 rapid close/open cycles, write pipeline verified on final sessionReconnect_SameObject_CallbacksFireInCorrectOrder—connected → data → disconnectedordering verified across 3 sessions
Documentation
open()declaration inwebsocket.hppannotated 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
onDisconnectedfires versus is suppressed in the rapid-reconnect edge case.
Release v2.0.3
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 aWebsocketwithout receiving further events.
Fixed
Websocketdestructor now explicitly callsreset_callbacks()followed byclose()instead of defaulting, preventing spurious callbacks from firing into already-destroyed caller state during object destruction.
Release v2.0.2
Changes
Added
- Added reason in Http::Response
Fixed
- HTTP response body is now always returned in
result_textregardless of status code. Previously, non-2xx responses (e.g. 400 Bad Request) setresult_textto the HTTP reason phrase instead of the response body, discarding any JSON error payload sent by the server.
Release v2.0.1
Changes
Chaged
- Updated SSE endpoint in excamples and tests
- Added timeout handling in HTTP stream sessions
Fixed
- WebSocket
co_spawncompletion handler now guardson_error_()with arun_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 useshared_ptrcaptures 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 newWebsocketinstance 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 (
connected→data→disconnected) - Concurrent dual-instance connect (shared SSL context)
Release v2.0.0
Changes
Changed
- BREAKING: Switched
slick::netfrom 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.hppset_log_handler(LogHandler)clear_log_handler()
- Added
logging_testsfor runtime logging hook dispatch behavior
Release v1.2.4
Changes
Fixed
- WebSocket error handling now properly ignores SSL stream_truncated errors
- Added
ssl::error::stream_truncatedto 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
- Added
- WebSocket read handler now uses
memory_order_releasewhen 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
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
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
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 afteropen()- Messages are now queued during
CONNECTINGstate 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
DISCONNECTEDandCONNECTINGstates
- Messages are now queued during
Testing
- Added comprehensive WebSocket unit tests for send-after-open scenarios:
SendImmediatelyAfterOpen_MessageQueuedAndSentAfterConnect- Single message testSendImmediatelyAfterOpen_MultipleMessages- Multiple messages queuing testSendImmediatelyAfterOpen_VerifyOrderPreserved- Message ordering verificationSendImmediatelyAfterOpen_LargeMessage- Large message (5KB) queueing test
Build System
- Added CMake installation rules for proper package export
- Created
slick_net-config.cmake.intemplate 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