forked from SaltwaterC/aws2js
-
Notifications
You must be signed in to change notification settings - Fork 0
client.setMaxSockets()
SaltwaterC edited this page Nov 15, 2011
·
4 revisions
Helper for setting the maximum number of concurrent outgoing HTTPS connections.
client.setMaxSockets(numberOfSockets)
- 'numberOfSockets' - unsigned integer value for setting the max sockets. Invalid values makes it to default to 5 (node.js default).
This works by setting the undocumented property: https.Agent.defaultMaxSockets. This change affects all the HTTP / HTTPS clients built on top of the core http.js / https.js libraries. In other words, if you call this helper for an aws2js client, it has side effects for other libraries using the core HTTP support.
Since the core modules themselves handle the concurrency, messing with the HTTP Agent per client instance brings little benefit, but it complicates the actual code that manages this feature. Therefore, using https.Agent.defaultMaxSockets is the preferred for achieving this goal of increasing the max concurrency.