Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d0e25ef7e5
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 31 lines (21 sloc) 0.779 kb

lazy-socket

Build Status

A stateless socket that always lets you write().

If there is an error, all previous write() callbacks will be honored. A new connection will be established as soon as the next write() occurs. Writes will not be retried.

Install

npm install lazy-socket

Usage

var LazySocket = require('lazy-socket');
var socket = LazySocket.createConnection(80, 'example.org');
socket.write('something', 'utf-8', function(err) {
  // Even if example.org is down, this callback is guaranteed to fire, and
  // there is no more error handling to do on your end.
});

License

This module is licensed under the MIT license.

Something went wrong with that request. Please try again.