You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I will close this as not an issue until proven otherwise. If you experience an issue related to reusing the same Socket instance across multiple requests, please comment below with a reproduction repository attached. Thanks.
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.
The text was updated successfully, but these errors were encountered: