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

Should return a new object every time #6

@RangerMauve

Description

@RangerMauve

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions