I'm establishing a streaming connection using http.get(). It's supposed to 
be kept alive forever but suddenly it dies with en ECONNREFUSED error that 
I cannot catch. 
I know everyone is sick of this type of error but no one says how to solve 
it. How can I catch that error and what the fuck is that?

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: connect ECONNREFUSED
    at errnoException (net.js:642:11)
    at Object.afterConnect [as oncomplete] (net.js:633:18)


This is the code that actually sends the request:

var options = {
host : 'stream.gnip.com',
port : 443,
path : '/accounts/NiceStream/publishers/twitter/streams/track/prod.json',
headers : {
'Authorization' : basicAuth(username, password),
'Accept-Encoding' : 'gzip'
}
};
 var req = https.get(options, function(res) {
var gunzip = zlib.createGunzip();
gunzip.on('data', function(data) {
self.parser.receive(data);
});
gunzip.on('error', function(err) {
self.emit('error', err);
});
res.pipe(gunzip);
res.on('error', function(err) {
self.emit('error', err);
self.end();
});
res.on('end', function() {
self.end();
});
});
req.on('error', function(err) {
self.emit('error', err);
self.end();
});
req.end();

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to