mirror of https://github.com/nodejs/node.git
Revert "Remove 'connect' event from server side sockets"
Fixes #1276
This reverts commit f0a440d886
.
v0.7.4-release
parent
e8542b6220
commit
ede1acc1ed
|
@ -955,6 +955,15 @@ function Server(/* [ options, ] listener */) {
|
||||||
|
|
||||||
DTRACE_NET_SERVER_CONNECTION(s);
|
DTRACE_NET_SERVER_CONNECTION(s);
|
||||||
self.emit('connection', s);
|
self.emit('connection', s);
|
||||||
|
|
||||||
|
// The 'connect' event probably should be removed for server-side
|
||||||
|
// sockets. It's redundant.
|
||||||
|
try {
|
||||||
|
s.emit('connect');
|
||||||
|
} catch (e) {
|
||||||
|
s.destroy(e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,9 @@ var client_recv_count = 0;
|
||||||
var disconnect_count = 0;
|
var disconnect_count = 0;
|
||||||
|
|
||||||
var server = net.createServer(function(socket) {
|
var server = net.createServer(function(socket) {
|
||||||
|
socket.addListener('connect', function() {
|
||||||
socket.write('hello\r\n');
|
socket.write('hello\r\n');
|
||||||
|
});
|
||||||
|
|
||||||
socket.addListener('end', function() {
|
socket.addListener('end', function() {
|
||||||
socket.end();
|
socket.end();
|
||||||
|
|
Loading…
Reference in New Issue