Project

General

Profile

Actions

Feature #11072

closed

[PATCH] connect_nonblock(..., exception: false) does not raise EISCONN

Added by normalperson (Eric Wong) about 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-core:<unknown>]

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

Actions #1

Updated by akr (Akira Tanaka) about 7 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.

Actions #2

Updated by normalperson (Eric Wong) about 7 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

Actions #3

Updated by nobu (Nobuyoshi Nakada) about 7 years ago

Seems fine to me.

Actions #4

Updated by Anonymous about 7 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.

Actions

Also available in: Atom PDF