diff --git a/lib/net.js b/lib/net.js index d5e85b17e80..83ca47cccdc 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1118,7 +1118,6 @@ function onconnection(clientHandle) { DTRACE_NET_SERVER_CONNECTION(socket); COUNTER_NET_SERVER_CONNECTION(socket); self.emit('connection', socket); - socket.emit('connect'); } diff --git a/test/pummel/test-net-throttle.js b/test/pummel/test-net-throttle.js index 29fd184916f..e99a79848ed 100644 --- a/test/pummel/test-net-throttle.js +++ b/test/pummel/test-net-throttle.js @@ -40,15 +40,12 @@ for (var i = 0; i < N; i++) { console.log('start server on port ' + common.PORT); var server = net.createServer(function(connection) { - connection.on('connect', function() { - connection.write(body.slice(0, part_N)); - connection.write(body.slice(part_N, 2 * part_N)); - assert.equal(false, connection.write(body.slice(2 * part_N, N))); - console.log('bufferSize: ' + connection.bufferSize); - assert.ok(0 <= connection.bufferSize && - connection.bufferSize <= N); - connection.end(); - }); + connection.write(body.slice(0, part_N)); + connection.write(body.slice(part_N, 2 * part_N)); + assert.equal(false, connection.write(body.slice(2 * part_N, N))); + console.log('bufferSize: ' + connection.bufferSize); + assert.ok(0 <= connection.bufferSize && connection.bufferSize <= N); + connection.end(); }); server.listen(common.PORT, function() { diff --git a/test/simple/test-net-reconnect.js b/test/simple/test-net-reconnect.js index 58e0fef6277..f4b19977eea 100644 --- a/test/simple/test-net-reconnect.js +++ b/test/simple/test-net-reconnect.js @@ -33,10 +33,8 @@ var server = net.createServer(function(socket) { console.error('SERVER: got socket connection'); socket.resume(); - socket.on('connect', function() { - console.error('SERVER connect, writing'); - socket.write('hello\r\n'); - }); + console.error('SERVER connect, writing'); + socket.write('hello\r\n'); socket.on('end', function() { console.error('SERVER socket end, calling end()');