diff --git a/src/client/connection.ts b/src/client/connection.ts index 654d776..bb53970 100644 --- a/src/client/connection.ts +++ b/src/client/connection.ts @@ -334,7 +334,7 @@ export class Connection extends EventEmitter implements IConnection { }) socket.on('close', () => { - if (this._readyState === ReadyState.CLOSING || !this._connectionTimer) { + if (this._readyState === ReadyState.CLOSING || (this._connectionTimer == null)) { this._readyState = ReadyState.CLOSED } else { connectionError = (connectionError != null) ? connectionError : new HL7FatalError('Socket closed unexpectedly by server.')