var net = require('net');
var server = net.createServer(function(c) { //'connection' listener
console.log('server connected');
c.timeout = 0;
c.on('end', function() {
console.log('server disconnected');
});
c.on('data', function(data) {
console.log('Received: ' + data);
});
server.on('error', function (e) {
if (e.code == 'ECONNRESET') {
console.log('RST');
}});
//c.write('hello\r\n');
//c.pipe(c);
});
server.listen(8000, function() { //'listening' listener
console.log('server bound');
});
Please give it a try to see what is the source of the problem.