Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Should return a new object every time #6

Open
RangerMauve opened this issue Apr 24, 2019 · 0 comments
Open

Should return a new object every time #6

RangerMauve opened this issue Apr 24, 2019 · 0 comments

Comments

@RangerMauve
Copy link
Contributor

There's a bug in discovery-swarm-stream when you try to use it with dat-swarm-defaults multiple times.

When UTP is enabled, it sets opts.dns.socket to a value. This socket will then get globally reused across all future calls of dat-swarm-defaults because opts.dns references a global object.

The symptoms are that you can't close the discovery swarm since the dns-discovery code is calling .close() on this global socket which is already closed from the previous run.

Of course we should probably fix this inside discovery-swarm, but I think it'd be better to avoid this issue happening in any other modules where developers might not be aware of the potential error.

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

No branches or pull requests

1 participant