emacs/nt/inc
Eli Zaretskii d133cf8394 Support non-blocking connect on MS-Windows (Bug#20207)
Based on ideas from Kim F. Storm <storm@cua.dk>, see
 http://lists.gnu.org/archive/html/emacs-devel/2006-12/msg00873.html.

 src/w32proc.c (reader_thread): If the FILE_CONNECT flag is set, call
 '_sys_wait_connect'.  If it returns STATUS_CONNECT_FAILED, exit
 the thread with code 2.
 (sys_select): Support 'wfds' in addition to 'rfds'.  If a
 descriptor in 'wfds' has its bit set, but the corresponding
 fd_info member doesn't have its FILE_CONNECT flag set, ignore the
 descriptor.  Otherwise, acknowledge a successful non-blocking
 connect by resetting the FILE_CONNECT flag and setting cp->status
 to STATUS_READ_ACKNOWLEDGED.
 src/w32.h (STATUS_CONNECT_FAILED): New enumeration value.
 (struct _child_process): New member 'errcode'.
 (FILE_CONNECT): New flag.
 (_sys_wait_connect): Add prototype.
 src/w32.c (pfn_WSAEnumNetworkEvents): New function pointer.
 (init_winsock): Load WSAEnumNetworkEvents from winsock DLL.
 (set_errno): Map WSAEWOULDBLOCK and WSAENOTCONN.
 (sys_connect): Support non-blocking 'connect' calls by setting the
 FILE_CONNECT flag in the fd_info member and returning EINPROGRESS.
 (_sys_read_ahead): Add debug message if this function is called
 for a descriptor that waits for a non-blocking connect to complete.
 (_sys_wait_connect): New function.
 (sys_read): Support STATUS_CONNECT_FAILED.  Return the error code
 recorded by _sys_wait_connect when the non-blocking connect
 failed.  Don't call WSAGetLastError before a call to set_errno had
 a chance to use its value, since WSAGetLastError clears the last
 error.

 nt/inc/ms-w32.h (BROKEN_NON_BLOCKING_CONNECT): Don't define.
2015-03-27 12:44:31 +03:00
..
arpa Nuke arch-tags. 2011-01-15 15:16:57 -08:00
netinet Nuke arch-tags. 2011-01-15 15:16:57 -08:00
sys Update copyright year to 2015 2015-01-01 14:26:41 -08:00
dirent.h Dirent functions and directory-files are converted and work. 2013-11-09 14:49:02 +02:00
grp.h Update copyright year to 2015 2015-01-01 14:26:41 -08:00
inttypes.h Update copyright year to 2015 2015-01-01 14:26:41 -08:00
langinfo.h Update copyright year to 2015 2015-01-01 14:26:41 -08:00
mingw_time.h Attempt to fix time_t related problems with MinGW 4.0 runtime. 2013-10-14 19:23:10 +03:00
ms-w32.h Support non-blocking connect on MS-Windows (Bug#20207) 2015-03-27 12:44:31 +03:00
netdb.h Nuke arch-tags. 2011-01-15 15:16:57 -08:00
nl_types.h Update copyright year to 2015 2015-01-01 14:26:41 -08:00
pwd.h Fix warnings when compiling on MS-Windows with -std=gnu99. 2012-10-17 21:02:44 +02:00
stdalign.h MS-Windows followup for 2012-07-28T23:05:32Z!eggert@cs.ucla.edu. 2012-07-29 18:43:09 +03:00
stdbool.h Fix the MS-Windows build broken by 2011-01-30T23:34:18Z!eggert@cs.ucla.edu and 2011-01-31T08:15:13Z!eggert@cs.ucla.edu. 2011-01-31 21:36:08 +02:00
stdint.h Update copyright year to 2015 2015-01-01 14:26:41 -08:00
unistd.h Merge from trunk and resolve conflicts. 2013-03-28 20:13:59 +02:00