Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
var net = require('net');
var sleep = require('sleep');
var client = new net.Socket();
client.connect(6379, '', function() {
sleep.sleep(10); // wait for data and RST package
client.on('data', function(data) {
console.log('Received: ' + data);
client.on('close', function() {
console.log('Connection closed');

pfreixes commented Jul 17, 2017


$ node test_nodejs.js
Received: -ERR max number of clients reached

Connection closed

The data in the buffer can be read event the RST already came into the system

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment