1 var common = require('../common');
2 var assert = require('assert');
3 var net = require('net');
5 var buf = new Buffer(10 * 1024 * 1024);
11 var srv = net.createServer(function onConnection(conn) {
13 conn.on('error', function (err) {
15 if (errs.length > 1 && errs[0] === errs[1])
16 assert(false, "We should not be emitting the same error twice");
18 conn.on('close', function() {
21 }).listen(common.PORT, function () {
22 var client = net.connect({ port: common.PORT });
24 client.on('connect', function () {
29 process.on('exit', function() {
31 assert.equal(errs.length, 1);