end of connection more then once
See original GitHub issueWhen we close the pool connection it call the close of the connection and then call the callback. When we do it twice the callback not call.
The suggested solution is: At the connection end function we first check if already closed
end(callback) { if(this._closing){ return callback(); } this._closing = true; if (this.config.isServer) { const quitCmd = new EventEmitter(); setImmediate(() => { this.stream.end(); quitCmd.emit('end'); }); return quitCmd; } // trigger error if more commands enqueued after end command const quitCmd = this.addCommand(new Commands.Quit(callback)); this.addCommand = this._addCommandClosedState; return quitCmd; }
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
End Connection - an overview | ScienceDirect Topics
An end-to-end connection in a wireless network is composed of one or more wireless and wired links, with at least one wireless link....
Read more >The Four Horsemen: Criticism, Contempt, Defensiveness ...
We use this metaphor to describe communication styles that, according to our research, can predict the end of a relationship.
Read more >In a Multipoint connection more than two devices can ... - Toppr
In a Multipoint connection more than two devices can share a single link. A multipoint connection is a communication channel between two or...
Read more >Support and Connection Types
Roller supports are commonly located at one end of long bridges. This allows the bridge structure to expand and contract with temperature changes....
Read more >One-Sided Relationships: 24 Signs, Causes & Ways To Fix It
A one-sided relationship is an imbalanced relationship where one person invests more time, energy, effort, and support than the other person ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@talGibly1 Agree, that should work. would you like to submit a PR?
I think the right behavior should be that if you call
end()
more than once, the second time, it should fail.