1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/socket
normal 7914a8726e socket (rsock_connect): fix and refactor for blocking
* ext/socket/init.c (rsock_connect): refactor for blocking
  (wait_connectable): clear error before wait
  [Bug #9356]

We no longer use non-blocking sockets to emulate blocking behavior,
so eliminate error-prone and confusing platform-dependent code.
According to POSIX, connect() only needs to be called once in the
face of EINTR, so do not loop on it.

Before waiting on connect, drop any pending errors, since
rb_wait_for_single_fd may not clear the existing error
properly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-17 21:20:58 +00:00
..
lib * ext/socket/lib/socket.rb: Don't test $! in "ensure" clause because 2013-12-13 16:11:12 +00:00
.document * ext/socket/.document: Add ifaddr.c. 2013-05-14 14:48:00 +00:00
addrinfo.h * ext/**/*.[ch]: removed trailing spaces. 2010-04-22 08:04:13 +00:00
ancdata.c socket: sendmsg/recvmsg only retries blocking on errors 2014-02-21 00:55:13 +00:00
basicsocket.c * ext/socket: Avoid unnecessary ppoll/select on Linux. 2014-01-18 14:13:22 +00:00
constants.c constants.c: fix macro name 2013-04-08 15:28:43 +00:00
depend Fix a dependency. 2013-05-16 10:29:05 +00:00
extconf.rb * ext/socket/extconf.rb: Don't check fields of struct tcp_info if the 2014-05-19 20:00:00 +00:00
getaddrinfo.c {getaddrinfo,getnameinfo}.c: fix for old platforms 2013-05-03 04:35:37 +00:00
getnameinfo.c {getaddrinfo,getnameinfo}.c: fix for old platforms 2013-05-03 04:35:37 +00:00
ifaddr.c * ext/socket/ifaddr.c (ifaddr_inspect_flags): support IFF_SIMPLEX. 2014-05-27 12:29:19 +00:00
init.c socket (rsock_connect): fix and refactor for blocking 2014-09-17 21:20:58 +00:00
ipsocket.c * ext/socket: Wrap struct addrinfo by struct rb_addrinfo. 2014-02-19 09:38:24 +00:00
mkconstants.rb * ext/socket/mkconstants.rb: More constants 2014-05-23 20:54:40 +00:00
option.c * ext/socket/option.c: Fix complation error on Android. 2014-05-21 03:22:18 +00:00
raddrinfo.c introduce ZALLOC{,_N} to replace ALLOC{,_N}+MEMZERO use 2014-07-25 21:34:35 +00:00
rubysocket.h * ext/socket/option.c (inspect_tcp_info): New function to inspect struct tcp_info. 2014-05-19 11:52:03 +00:00
socket.c * ext/socket/socket.c (sock_gethostname): Use NI_MAXHOST to support 2014-07-25 04:17:50 +00:00
sockport.h * ext/socket: Bypass getaddrinfo() if node and serv are numeric. 2014-02-19 10:37:43 +00:00
sockssocket.c * ext/socket: Make Socket documentation appear. Add documentation for 2011-08-15 23:08:39 +00:00
tcpserver.c * ext/socket/unixserver.c: [DOC] Document #accept 2013-08-19 16:54:59 +00:00
tcpsocket.c socket: ai_addrlen is socklen_t 2013-02-15 07:54:38 +00:00
udpsocket.c * ext/socket: Wrap struct addrinfo by struct rb_addrinfo. 2014-02-19 09:38:24 +00:00
unixserver.c * ext/socket/unixserver.c: [DOC] Document #accept 2013-08-19 16:54:59 +00:00
unixsocket.c * ext/socket/unixsocket.c (rsock_init_unixsock): Open a socket 2014-05-28 15:42:09 +00:00