Skip to content

Commit 6b61e12

Browse files
author
Christian Stimming
committed
Set the timer only for non-zero timeouts
1 parent 2eddb65 commit 6b61e12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dcom/transport/comtransport.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class ComTransport extends events.EventEmitter
117117
}
118118
});
119119

120-
const connectFailedTimer = setTimeout(() =>
120+
const connectFailedTimer = self.timeout && setTimeout(() =>
121121
channel.emit('error', 'Connection could not be established'), self.timeout)
122122
channel.connect(Number.parseInt(self.port), self.host, () => {
123123
clearTimeout(connectFailedTimer)

0 commit comments

Comments
 (0)