Feature #11072 ยป 0001-connect_nonblock-.-exception-false-does-not-raise-EI.patch
ext/socket/socket.c | ||
---|---|---|
}
|
||
rb_readwrite_sys_fail(RB_IO_WAIT_WRITABLE, "connect(2) would block");
|
||
}
|
||
if (errno == EISCONN) {
|
||
if (!NIL_P(opts) &&
|
||
Qfalse == rb_hash_lookup2(opts, sym_exception, Qundef)) {
|
||
return INT2FIX(0);
|
||
}
|
||
}
|
||
rsock_sys_fail_raddrinfo_or_sockaddr("connect(2)", addr, rai);
|
||
}
|
||
test/socket/test_nonblock.rb | ||
---|---|---|
assert_equal :wait_writable, rv
|
||
end
|
||
assert_equal([ [], [c], [] ], IO.select(nil, [c], nil, 60))
|
||
assert_equal 0, c.connect_nonblock(servaddr, exception: false)
|
||
s, sockaddr = serv.accept
|
||
assert_equal(Socket.unpack_sockaddr_in(c.getsockname),
|
||
Socket.unpack_sockaddr_in(sockaddr))
|
||
-
|