1.1.0 • Published 7 years ago

net-socket v1.1.0

Weekly downloads
594
License
WTFPL
Repository
github
Last release
7 years ago

net-socket

net.Socket that automatically reconnects if a server goes down. Maintains 100% compatibility with net.Socket.

Installation

$ npm install net-socket --save

Usage

For detailed usage, see Node.js documentation on net.Socket - https://nodejs.org/api/net.html#net_class_net_socket.

Quick example:

var net = require('net-socket');

var socket = net.connect(7777, 'localhost');

socket.setEncoding('utf8');
socket.on('connect', function () {
	// connected
	
	socket.end('hey');
	socket.destroy();
});

WARNING: To prevent socket from reconnecting, use .destroy() method to completely close it.

Tests

Circle CI

$ npm test

License

WTFPL – Do What the Fuck You Want to Public License

1.1.0

7 years ago

1.0.0

9 years ago