Skip to content

Instantly share code, notes, and snippets.

@heapwolf heapwolf/37.js
Created Aug 7, 2012

Embed
What would you like to do?
tcp/close
var server = require('net').createServer(function(socket) {
socket.setEncoding('utf8');
socket.on('data', function(data) {
if (data.trim() === 'close') {
server.close();
}
});
});
server.listen(4001);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.