Skip to content
This repository has been archived by the owner on Feb 5, 2020. It is now read-only.

How to close? #39

Closed
jacoscaz opened this issue Oct 9, 2017 · 3 comments
Closed

How to close? #39

jacoscaz opened this issue Oct 9, 2017 · 3 comments
Assignees
Labels

Comments

@jacoscaz
Copy link

jacoscaz commented Oct 9, 2017

Possibly related to #38.

I have a Mocha suite in which I'm trying to tear down and re-create a ldf-client (and a ldf-server) using beforeEach() / afterEach(). However, I can't seem to find a way to force the client to close its connections. .abortAll() does not seem to work. The moment the ldf-server destroys the connection, ECONNREFUSED comes up. Any tips?

EDIT: branch is feature-qpf-latest

@joachimvh
Copy link
Member

For now the abortAll function has been updated to make sure it will always stop all connections (in the develop branch, so will have to be added to the other branches too). This is still not a completely clean solution as abortAll was intended as a hackish way to quickly disable the system (for the browser client).

So the safest solution would probably be to catch the errors when closing in the afterEach and creating a new client in the beforeEach.

@jacoscaz
Copy link
Author

For anyone interested, the stoppable module (https://github.com/hunterloftis/stoppable) tracks the state of http connections and allows to shut down a server as soon as possible - keep-alive connections included - while still allowing in-flight requests to go through. Nifty module!

@rubensworks
Copy link
Member

This project has now been deprecated in favor of Comunica, where this should not be a problem anymore. If it is, feel free to open a new issue there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants