You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement a Winsock TCP stream (SolidSyslogWinsockTcpStream) using winsock2.h, providing the SolidSyslogStream interface. The Windows TCP path mirrors SolidSyslogPosixTcpStream (extracted in S13.08 and hardened in S12.08) with platform-appropriate type and error-handling adjustments.
Platform/Windows/Source/SolidSyslogWinsockTcpStreamInternal.h — UT_PTR_SET test seam with WinsockTcpStream_* namespaced forwarders (avoids colliding with Winsock_socket/Winsock_closesocket already exported by SolidSyslogWinsockDatagram)
Tests/Support/WinsockFake.{h,c} extended with connect, send, recv, setsockopt fakes plus configuration knobs (mirrors S12.08 SocketFake additions)
Tests/SolidSyslogWinsockTcpStreamTest.cpp — port of SolidSyslogPosixTcpStreamTest.cpp adjusted for Winsock (no EINTR retry, flags = 0 instead of MSG_NOSIGNAL, generic send-error in place of EAGAIN-specific test)
CMake: sources added when SOLIDSYSLOG_WINSOCK is true; library already links ws2_32
All CI checks green including windows-build-and-test
SOLIDSYSLOG_TCP_DEFAULT_PORT and SOLIDSYSLOG_UDP_DEFAULT_PORT consolidated into Core/Interface/SolidSyslogTransport.h so the new Winsock TCP stream does not duplicate the constant. Both are platform-agnostic IANA/RFC facts and naturally pair with the SolidSyslogTransport enum already in that header. SolidSyslogUdpSender.h, SolidSyslogPosixTcpStream.h, and the new SolidSyslogWinsockTcpStream.h#include "SolidSyslogTransport.h" so existing callers continue to get the constants transitively.
SOCKET (unsigned UINT_PTR) instead of int; INVALID_SOCKET instead of -1; closesocket() instead of close(); Winsock send/recv return int instead of ssize_t
SO_SNDTIMEO: DWORD milliseconds on Winsock instead of POSIX struct timeval; same level/optname so tests can assert on the pair via HasSetSockOpt
EINTR retry path pruned — Winsock send() has no signal-interruption semantics
MSG_NOSIGNAL removed — Winsock does not generate SIGPIPE, flags pass as 0
No WSAGetLastError() needed — vtable contract is bool; caller already handles "false → close + reconnect → store-and-forward replays" identically to PosixTcpStream
Test seam follows the WinsockDatagram / WinsockResolver precedent (UT_PTR_SET on file-scope function-pointer forwarders) but uses WinsockTcpStream_* namespaced symbols to avoid linker collisions with the un-namespaced Winsock_* already exported by WinsockDatagram
No #ifdef in source files — platform differences handled entirely in CMake
Out of scope (deferred to S13.10)
Wiring TCP into Example/Windows/SolidSyslogWindowsExample.c
BDD scenario for Windows TCP delivery to syslog-ng
End-to-end exercise via windows-build-and-test
Context
Completes the Windows TCP transport path. Combined with WinsockResolver (S13.04) and the Stream abstraction (S13.08), this enables TCP syslog delivery on Windows. S13.10 then proves the path end-to-end against syslog-ng in BDD and wires it into the Windows example.
Parent epic: #40
Goal
Implement a Winsock TCP stream (
SolidSyslogWinsockTcpStream) usingwinsock2.h, providing theSolidSyslogStreaminterface. The Windows TCP path mirrorsSolidSyslogPosixTcpStream(extracted in S13.08 and hardened in S12.08) with platform-appropriate type and error-handling adjustments.Acceptance criteria
Platform/Windows/Interface/SolidSyslogWinsockTcpStream.h— Create/Destroy,SolidSyslogWinsockTcpStreamStorage,SOLIDSYSLOG_WINSOCK_TCP_STREAM_SIZEPlatform/Windows/Source/SolidSyslogWinsockTcpStream.c— implementation usingsocket,connect,send,recv,closesocket,setsockopt(TCP_NODELAY + SO_SNDTIMEO)Platform/Windows/Source/SolidSyslogWinsockTcpStreamInternal.h— UT_PTR_SET test seam withWinsockTcpStream_*namespaced forwarders (avoids colliding withWinsock_socket/Winsock_closesocketalready exported bySolidSyslogWinsockDatagram)Tests/Support/WinsockFake.{h,c}extended withconnect,send,recv,setsockoptfakes plus configuration knobs (mirrors S12.08 SocketFake additions)Tests/SolidSyslogWinsockTcpStreamTest.cpp— port ofSolidSyslogPosixTcpStreamTest.cppadjusted for Winsock (no EINTR retry, flags = 0 instead ofMSG_NOSIGNAL, generic send-error in place of EAGAIN-specific test)SOLIDSYSLOG_WINSOCKis true; library already linksws2_32windows-build-and-testWSAStartup/WSACleanup— documented as precondition (matches existing Winsock pattern)Prep refactor (same branch, separate commit)
SOLIDSYSLOG_TCP_DEFAULT_PORTandSOLIDSYSLOG_UDP_DEFAULT_PORTconsolidated intoCore/Interface/SolidSyslogTransport.hso the new Winsock TCP stream does not duplicate the constant. Both are platform-agnostic IANA/RFC facts and naturally pair with theSolidSyslogTransportenum already in that header.SolidSyslogUdpSender.h,SolidSyslogPosixTcpStream.h, and the newSolidSyslogWinsockTcpStream.h#include "SolidSyslogTransport.h"so existing callers continue to get the constants transitively.Design decisions
SolidSyslogStreaminterface extracted in S13.08 (S13.08: Extract Stream abstraction, provide PosixTcpStream #134); production logic mirrors PosixTcpStream after the S12.08 error-edge workSOCKET(unsignedUINT_PTR) instead ofint;INVALID_SOCKETinstead of-1;closesocket()instead ofclose(); Winsocksend/recvreturnintinstead ofssize_tSO_SNDTIMEO:DWORDmilliseconds on Winsock instead of POSIXstruct timeval; same level/optname so tests can assert on the pair viaHasSetSockOptsend()has no signal-interruption semanticsMSG_NOSIGNALremoved — Winsock does not generate SIGPIPE, flags pass as0WSAGetLastError()needed — vtable contract isbool; caller already handles "false → close + reconnect → store-and-forward replays" identically to PosixTcpStreamWinsockDatagram/WinsockResolverprecedent (UT_PTR_SET on file-scope function-pointer forwarders) but usesWinsockTcpStream_*namespaced symbols to avoid linker collisions with the un-namespacedWinsock_*already exported byWinsockDatagram#ifdefin source files — platform differences handled entirely in CMakeOut of scope (deferred to S13.10)
Example/Windows/SolidSyslogWindowsExample.cwindows-build-and-testContext
Completes the Windows TCP transport path. Combined with
WinsockResolver(S13.04) and theStreamabstraction (S13.08), this enables TCP syslog delivery on Windows. S13.10 then proves the path end-to-end against syslog-ng in BDD and wires it into the Windows example.