title: Sending many requests from Node.js to an API causes error
body: <p>I have more than 2000 user in my database , when I try to broadcast a message to all users, it barely sends about 200 request then my server stops and I get an error as below : </p>
  
  <pre><code>{ Error: connect ETIMEDOUT 31.13.88.4:443
  at Object.exports._errnoException (util.js:1026:11)
  at exports._exceptionWithHostPort (util.js:1049:20)
  at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect,
  address: '31.13.88.4',
  port: 443 }
  </code></pre>
  
  <p><em>Sometimes</em> I get another error that says : </p>
  
  <pre><code>Error!: Error: socket hang up 
  </code></pre>
  
  <p>This is my request : </p>
  
  <pre><code>function callSendAPI(messageData) {
    request({
      uri: 'https://graph.facebook.com/v2.6/me/messages',
      qs: { access_token: '#####' },
      method: 'POST',
      json: messageData
  
    }, function (error, response, body) {
      if (!error &amp;&amp; response.statusCode == 200) {
        var recipientId = body.recipient_id;
        var messageId = body.message_id;
  
        if (messageId) {
          console.log("Successfully sent message with id %s to recipient %s", 
            messageId, recipientId);
        } else {
        console.log("Successfully called Send API for recipient %s", 
          recipientId);
        }
      } else {
        console.error("Failed calling Send API");
        console.log(error)
      }
    });  
  }
  </code></pre>
  
  <p><strong>I have tried</strong></p>
  
  <p><code>setTimeout</code> to make the the API calling wait for a while:</p>
  
  <pre><code> setTimeout(function(){callSendAPI(data)},200);
  </code></pre>
  
  <p>Can anyone help if he/she faced a similar error ?</p>
  
  <p><strong>EDITED</strong></p>
  
  <p>I'm using Messenger Platform which support high rate of calls to the Send API and it is not limited with 200 calls . </p>