@naxmefy/socket
autoreconnecting net.Socket implementation
Last updated 3 years ago by naxmefy .
MIT · Original npm · Tarball · package.json
$ cnpm install @naxmefy/socket 
SYNC missed versions from official npm registry.

@naxmefy/socket

Installation

$ npm install @naxmefy/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:

const Socket = require('@naxmefy/socket')
var socket = Socket.connect(1337, 'localhost')

socket.setEncoding('utf8')
socket.on('connect', function () {
	// connected

socket.end('hey')
	socket.destroy()
})

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

Tests

$ npm test

License

MIT

Current Tags

  • 1.3.0                                ...           latest (3 years ago)

5 Versions

  • 1.3.0                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |