Skip to content

Instantly share code, notes, and snippets.

@ry
Created May 21, 2010 00:34
Show Gist options
  • Save ry/408325 to your computer and use it in GitHub Desktop.
Save ry/408325 to your computer and use it in GitHub Desktop.
sys = require('sys');
net = require('net');
server = net.createServer(function (s) {
s.destroy();
server.close();
});
server.listen(9090);
server.addListener('listening', function ( ) {
var connection = net.createConnection(9090);
connection.addListener('connect', function () {
sys.debug('connect event');
});
connection.addListener('close', function () {
sys.debug('connect event');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment