question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

end of connection more then once

See original GitHub issue

When 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:open
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sidorarescommented, Jul 5, 2021

@talGibly1 Agree, that should work. would you like to submit a PR?

0reactions
testncommented, Oct 28, 2021

I think the right behavior should be that if you call end() more than once, the second time, it should fail.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found