Skip to content

Commit 81ff811

Browse files
Merge pull request #3 from nrcmedia/master
Destroy the gateway connection on error, so reconnection works also when the connection is dropped instead of closed.
2 parents 42f7321 + 7eb8cb3 commit 81ff811

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: lib/apnagent/agent/live.js

+3
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ Agent.prototype.connect = function (cb) {
154154
// emit errors;
155155
gateway.on('error', function (err) {
156156
debug('(gateway) error: %s', err.message || 'Unspecified Error');
157+
if (self.gateway) {
158+
self.gateway.destroy();
159+
}
157160
self.emit('gateway:error', err);
158161
});
159162

0 commit comments

Comments
 (0)