Skip to content

Signature of TCPSocket initializer doesn't match standard library signature #2

@petergoldstein

Description

@petergoldstein

In the standard Ruby library since 3.0.0 the signature for the TCPSocket initializer is

TCPSocket.new(remote_host, remote_port, local_host=nil, local_port=nil, connect_timeout: nil) link

I should be able to call the initializer with a remote_host, a remote_port, and a connect_timeout entry, like so:

TCPSocket.new('host.example.com', 1234, connect_timeout: 1000)

This works against the standard library, but fails when resolv-replace is in place, because the connect_timeout keyword argument is not properly handled. Instead, the connect_timeout argument is treated as a hash { connect_timeout: 1000 } as there's an error when this is used as the local_host value.

As linked below, this is causing an issue for some users of Dalli.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions