In windows, sockets need to be initialized, as shown in Networks.
On Windows operating systems, the networking subsystem has to be initialised using with
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.