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
.document
addrinfo.h
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
depend
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
getnameinfo.c
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
tcpserver.c
tcpsocket.c
udpsocket.c * ext/socket: Wrap struct addrinfo by struct rb_addrinfo. 2014-02-19 09:38:24 +00:00
unixserver.c
unixsocket.c * ext/socket/unixsocket.c (rsock_init_unixsock): Open a socket 2014-05-28 15:42:09 +00:00