Skip to content

Instantly share code, notes, and snippets.

@isaacs isaacs/n.js
Last active Dec 14, 2015

Embed
What would you like to do?
var net = require('net');
var server = net.createServer({ allowHalfOpen: true }, function(sock) {
sock.on('data', function(c) {
console.error('SERVER data %j', c.toString());
});
sock.on('end', function() {
console.error('SERVER message received, responding');
sock.write('hello1');
sock.write('hello2');
sock.write('hello3');
sock.end('THUNDERMUSCLE!');
});
});
server.listen(1337);
var sock = net.connect(1337);
sock.on('data', function(c) {
console.error('CLIENT data %j', c.toString());
});
sock.on('end', function() {
console.error('CLIENT end');
});
sock.write('hello1');
sock.write('hello2');
sock.write('hello3');
sock.end('THUNDERMUSCLE!');
@ghost

This comment has been minimized.

Copy link

commented Mar 2, 2013

'THUNDERMUSCLE!'
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.