peer: error handling.

This commit is contained in:
Christopher Jeffrey 2016-07-27 05:51:49 -07:00
parent 0b620c2e47
commit 52dd3c2cdc
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -209,6 +209,7 @@ Peer.prototype._init = function init() {
case 'EHOSTUNREACH': case 'EHOSTUNREACH':
case 'ENETUNREACH': case 'ENETUNREACH':
case 'ENOTFOUND': case 'ENOTFOUND':
case 'ECONNRESET':
self.ignore(); self.ignore();
break; break;
} }
@ -216,7 +217,6 @@ Peer.prototype._init = function init() {
this.socket.once('close', function() { this.socket.once('close', function() {
self._error('socket hangup'); self._error('socket hangup');
self.connected = false;
}); });
this.socket.on('data', function(chunk) { this.socket.on('data', function(chunk) {