Skip to content

Instantly share code, notes, and snippets.

@goloroden
Created October 15, 2014 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goloroden/4621d7c1f49b3d8b8a33 to your computer and use it in GitHub Desktop.
Save goloroden/4621d7c1f49b3d8b8a33 to your computer and use it in GitHub Desktop.
Listen for data
'use strict';
var net = require('net');
net.createServer(function (socket) {
socket.resume();
socket.once('end', function () {
socket.removeAllListeners();
});
}).listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment