Feature #11072
closed[PATCH] connect_nonblock(..., exception: false) does not raise EISCONN
Description
This is to reduce exceptions for code which issues a (IMHO,
unnecessary) second connect() syscall.
I'll update ext/socket/lib/socket.rb to reduce exceptions on
:connect_timeout if this is accepted.
Personally, I never bother issuing a second connect() syscall
anymore and just catch the failures when calling
write/read/sendmsg/recvmsg/etc, but maybe we need to keep the
second connect() syscall in socket.rb for some odd systems...
Files
Updated by akr (Akira Tanaka) about 9 years ago
Eric Wong wrote:
This is to reduce exceptions for code which issues a (IMHO,
unnecessary) second connect() syscall.I'll update ext/socket/lib/socket.rb to reduce exceptions on
:connect_timeout if this is accepted.
It is a good idea.
Personally, I never bother issuing a second connect() syscall
anymore and just catch the failures when calling
write/read/sendmsg/recvmsg/etc, but maybe we need to keep the
second connect() syscall in socket.rb for some odd systems...
I think it will affect applications.
Updated by normalperson (Eric Wong) about 9 years ago
- Assignee changed from akr (Akira Tanaka) to nobu (Nobuyoshi Nakada)
nobu/matz: any comment on just this patch? thanks.
akr: thanks for the comment, I will leave the second connect_nonblock call in socket.rb
Updated by Anonymous about 9 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset r50347.
connect_nonblock(..., exception: false) does not raise EISCONN
- ext/socket/socket.c (sock_connect_nonblock): do not raise EISCONN
[ruby-core:68926] [Feature #11072] - test/socket/test_nonblock.rb: check non-EISCONN on 2nd connect
This is to reduce exceptions for code which issues a
(IMHO, unnecessary) second connect() syscall.