Feature #11072
closed
[PATCH] connect_nonblock(..., exception: false) does not raise EISCONN
Added by normalperson (Eric Wong) over 9 years ago.
Updated over 9 years ago.
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
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.
- 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
- 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.
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0