Skip to content

Commit 2ddffdc

Browse files
author
Christian Stimming
committed
Set the timer only for non-zero timeouts
1 parent 08afb8b commit 2ddffdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dcom/transport/comtransport.js

+1-1
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)