Just in case we need to work hard in keeping ABI compatibility.
Set the socket to INVALID_SOCKET foir TCP and UDP handles and the handle to INVALID_HANDLE_VALUE on TTY handles after closing them.
Returns the platform specific file descriptor for handles that are backed by one. The datatype is abstracted as uv_os_fd_t, which maps to int on Unices and HANDLE on Windows. Users can use this function to set specific socket options, for example, in a non portable way. This function is essentially a shotgun, you better be careful with whatever you do with it, don't blame me if you used it to get the fd of a stream, close it yourself and expect things to Just Work.
Changes since version 0.11.28: * windows: make uv_read_stop immediately stop reading (Jameson Nash) * windows: fix uv__getaddrinfo_translate_error (Alexis Campailla) * netbsd: fix build (Saúl Ibarra Corretgé) * unix, windows: add uv_recv_buffer_size and uv_send_buffer_size (Andrius Bentkus) * windows: add support for UNC paths on uv_spawn (Paul Goldsmith) * windows: replace use of inet_addr with uv_inet_pton (Saúl Ibarra Corretgé) * unix: replace some asserts with returning errors (Andrius Bentkus) * windows: use OpenBSD implementation for uv_fs_mkdtemp (Pavel Platto) * windows: fix GetNameInfoW error handling (Alexis Campailla) * fs: introduce uv_readdir_next() and report types (Fedor Indutny) * fs: extend reported types in uv_fs_readdir_next (Saúl Ibarra Corretgé) * unix: read on stream even when UV__POLLHUP set. (Julien Gilli)
This fixes a SmartOS specific issue that happens when reading from a stream that is the reading end of a pipe that has been closed by the parent process. In this case, a UV__POLLHUP event would be set on the stream and would prevent the event loop from closing it. As a result, the event loop would think there are stil handles open, and leave the process hanging. Fixes #1419.
Fixes a compilation warning with Visual Studio 2013.
Don't hardcode the name of the executable, take it from the exepath. Fixes #1407
This implements locking around the blocking call to ReadFile to get around a Windows kernel bug where a blocking ReadFile operation on a stream can deadlock the thread. This allows uv_read_stop to immediately cancel a pending IO operation, and allows uv_pipe_getsockname to "pause" any pending read (from libuv) while it retrieves the sockname information. If unsupported by the OS (pre-Vista), this reverts to the old (e.g. deadlock-prone) behavior Closes #1313