Registry / networking / winsock2

winsock2

JSON →
library0.0vcpkgunverified

Windows Sockets.

vcpkg install winsock2
INSTALL
IMPORT
SIG · WINSOCK2
W
winsock2
networkingcppv0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

winsock2.h
#include <winsock2.h>

Initialize WinSock2, create a socket, and clean up

#include <winsock2.h> #include <iostream> int main() { WSADATA wsaData; if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0) { std::cerr << "WSAStartup failed" << std::endl; return 1; } SOCKET sock = socket(AF_INET, SOCK_STREAM, 0); closesocket(sock); WSACleanup(); return 0; }
Debug
Known issues
gotchaWinSock2 requires calling WSAStartup before any socket operations and WSACleanup at the end.
fix
Always pair WSAStartup with WSACleanup in your application lifecycle.
affects: *
Upgrade
Version history
0.0latest on vcpkg
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources

No resource links recorded.

winsock2 — pip install winsock2 · libregistry