Is it possible to tell if WSAStartup has been called in a process?

后端 未结 2 1047
太阳男子
太阳男子 2020-12-28 08:43

I\'ve started writing an ActiveX control that makes use of sockets.

Applications that use this control may or may not also use sockets. Is it possible for my control

2条回答
  •  再見小時候
    2020-12-28 09:05

    • No, it is not possible to tell if WSAStartup() has already been called.

    • Yes, WSAStartup() can be called multiple times in a single process, as long as the requested version is supported by the WinSock DLL. Calls to WSAStartup() and WSACleanup() must be balanced.

    • WinSock initialization is a negotiated process; you are responsible for validating the info that WSAStartup() returns to make sure it meets your app's requirements.

    • Existing sockets are not affected by subsequent WSAStartup() calls.

    • Multiple sockets using different WinSock versions is allowed.

    See the WSAStartup() documentation for more information.

提交回复
热议问题