Skip to content

Instantly share code, notes, and snippets.

View akbar-pardayev's full-sized avatar

Akbar Pardayev akbar-pardayev

View GitHub Profile
@akbar-pardayev
akbar-pardayev / client-socket-reconnect.js
Created August 27, 2019 10:23 — forked from sio2boss/client-socket-reconnect.js
Node.js Re-connecting Socket
//
// Simple example of using net.Socket but here we capture the
// right events and attempt to re-establish the connection when
// is is closed either because of an error establishing a
// connection or when the server closes the connection.
//
// Requires
var net = require('net');