Skip to content

Support reusing the same Socket for multiple requests #594

@kettanaito

Description

@kettanaito

In theory, you can reuse the same Socket instance for multiple HTTP requests. There's a bunch of Socket pools in the Agent and the agent decides which socket to use at which time.

That being said, I don't believe we allow our MockHttpSocket to be used that way. For once, each Socket instance has its own HTTP request/response parser instances, and I'm not sure if reusing sockets implies parallel reusing or sequential. I bet on sequential but who knows.

The tests for this are in works here: #560. I wasn't able to even recreate a raw, unmocked scenario of how you can reuse a socket like that. There's a solid chance I misread the Node.js docs and sockets cannot be used that way. No matter way I do with a keepalive socket/request, it never gets reused.

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