This patch makes uv_udp_set_socket responsible for setting the UV_HANDLE_IPV6 flag. It also fixes the problem that uv_udp_open would never set this flag at all. In addition, this patch fixes some minor style issues.
This makes uv_tcp_set_socket responsible for setting the UV_HANDLE_IPV6 flag. This fixes a couple of situations where the the fact that a socket is an IPv6 socket is not taken into account when deciding whether a call to SetFileCompletionNotificationModes is appropriate. It also fixes the issue that uv_tcp_open would never set this flag at all.
uv_winsock_init() tries to create an IPv4 socket in order to detect if the system has any layered service providers (LSPs) installed. When creating this socket failed it would call uv_fatal_error and exit with the following message: socket: (10047) An address incompatible with the requested protocol was used. This patch fixes that. It also includes some minor style tweaks.
Don't export _POSIX_C_SOURCE to dependents. On the BSDs (and the BSD-ish, like OS X), it hides SysV and BSD definitions. The exception is Linux: _POSIX_C_SOURCE=200112 unlocks some of the newer pthreads features like spinlocks and barriers, so keep exporting it on that platform.
Just like uv_tcp_connect() it should return an EINVAL when the handle is of an invalid type or when the network address is faulty.
This reverts commit 98bcddc. It's making a lot of tests in the node.js test suite fail.
* abort() if close() fails * set fd to -1 after close() to prevent double close bugs