Skip to content

Always call Socket#setTimeout in HTTP ClientRequest#setTimeout #32675

@mooyoul

Description

@mooyoul

Is your feature request related to a problem? Please describe.
Hello there.
Currently, ClientRequest#setTimeout and Socket#setTimeout has different behavior.
ClientRequest#setTimeout calls Socket#setTimeout right after connection has established.
I am not sure it is intended or not, but it's impossible to detect socket inactivity before connection establishment when using ClientRequest#setTimeout. It makes users harder to handle connect timeout.

Describe the solution you'd like
Always call Socket#setTimeout regardless of connection establishment.

Describe alternatives you've considered
None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpIssues or PRs related to the http subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions