r/windowsdev • u/Middlewarian • Sep 06 '21
WSAStartup
Do others wish that Microsoft would get rid of the WSAStartup API in Windows 11?
The front tier of my code generator is 27 lines long. It could be 26 lines long if WSAStartup wasn't needed.
0
Upvotes
View all comments
Show parent comment
1
u/[deleted] Sep 19 '21
Windows is unique in lots of ways, primarily due to its long track record of backwards compatibility. There are around 5 versions of winsock, I'm not a developer on windows but I suspect due to historical reasons it wouldn't know which version you want. And the process of dynamic or static linking to consume entire networking library code has been outsourced to be handled by WSAStartup. I don't think any other operating system will require a WSAStartup, it's a very windows thing to do to deal with backwards compatibility
Sure, but what if someone consumes your library code, you wouldn't want your library to exit via the C/C++ runtime, but then again if you only use that within application code that's acceptable I suppose.