In windows, sockets need to be initialized, as shown in Networks.
On Windows operating systems, the networking subsystem has to be initialised using withSocketsDo before any networking operations can be used. eg.
main = withSocketsDo $ do {...}
Although this is only strictly necessary on Windows platforms, it is harmless on other platforms, so for portability it is good practice to use it all the time.
What's special about windows?