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 da37ee1 commit 84f0a89
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../tsconfig.json",
"extends": "../tsconfig.esm.json",
"compilerOptions": {
"noEmit": true,
"typeRoots": ["../node_modules/@types", "../@types"]
Expand Down
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) {
if (this._readyState === ReadyState.CLOSING || !this._connectionTimer) {
this._readyState = ReadyState.CLOSED
} else {
connectionError = (connectionError != null) ? connectionError : new HL7FatalError('Socket closed unexpectedly by server.')
Expand Down

0 comments on commit 84f0a89

Please sign in to comment.