net-retry-connect
Attempt to connect to net Sockets using retry patterns.
net-retry-connect
is based on the Node.js net
module as well as the retry module.
Installation
npm install net-retry-connect --save
API
retryConnect.to(options, callback)
options
provides this options:
port
: the TCP porthost
: optional, defaults to'localhost'
retryOptions
, optional, see retry options for retry.operation
callback
returns a client object if connection has been successful. Otherwise it returns the error.
var retryConnect = ;retryConnect;
Usage of retryOptions
var retryConnect = ; // retry for 2 seconds onlyvar retryOptions = retries: 2 factor: 1; retryConnect;
Running the tests:
npm install
npm test