Skip to content

Commit

Permalink
fix: race condition
Browse files Browse the repository at this point in the history
- closes #100
  • Loading branch information
Bugs5382 committed Jun 24, 2024
1 parent 84f0a89 commit 4b9e6cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down

0 comments on commit 4b9e6cf

Please sign in to comment.