Repository navigation
Initialize Winsock before the host transports open a socket - #213
Merged
Merged
Conversation
This was referenced Oct 27, 2026
chrisuthe
marked this pull request as ready for review
October 27, 2026 04:27
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows every socket call fails until
WSAStartup()runs, and IXWebSocket leaves that to the application throughix::initNetSystem(). The client could neither dial a server ("Either the application has not called WSAStartup") nor listen.Summary
SendspinWsServer::start()andSendspinClientConnection::start()callix::initNetSystem()once, through a function-local static, before their first socket. It is never undone; Windows releases it at process exit.start()returns a bool, so it logs and returns false. The client'sstart()has no failure return, so it logs and lets the attempt go ahead; its first socket call then fails and IXWebSocket reports it as the connection'sError, which already reports the close.Notes
initNetSystem()returns true without doing anything there).Testing
basic_clientdials Music Assistant with-uand listens on its own port; before this change both failed with the WSAStartup error.sendspin_testsall pass. The ASan/UBSan and TSan runs are this PR's CI (no sanitizer runtime on the local machine).