Why does windows need withSocketsDo?

后端 未结 2 1429
夕颜
夕颜 2021-01-19 05:20

In windows, sockets need to be initialized, as shown in Networks.

On Windows operating systems, the networking subsystem has to be initialised using with

2条回答
  •  没有蜡笔的小新
    2021-01-19 05:39

    In existing versions of the network library, withSocketsDo is used to initialize the Winsock library, which is only a requirement on Windows. On other platforms no library needs initializing, so withSocketsDo does nothing.

    In future versions of the network library, withSocketsDo is called automatically, so only needs to be included for compatibility with older versions, see this blog post for the details behind the changes.

提交回复
热议问题