Friday, 19 April 2019

Is there a way to prevent Socket pooling when not used in the context of an http reqest?

Hi all,​I'm using a custom http.Agent with property maxSockets: 2​When testing the http module, I'm able to pass this custom agent and run multiple concurrent http.getrequests. In these cases, I'm seeing sockets being used twice before new sockets are created (as expected).​However, when using this agent's createConnection function to open sockets (without using the http module or making http requests), I'm noticing that for multiple concurrent calls, the same socket is always re-used.​Am I implementing this incorrectly? Is there a way to achieve non-reused sockets for the net.Socket module?​Thanks in advance!

Submitted April 19, 2019 at 11:10PM by ConceptOfWuv

No comments:

Post a Comment