*If the dht closes, then remove the connection handler and emit the close event on the swarm

This commit is contained in:
Derrick Hammer 2023-02-16 21:40:40 -05:00
parent 3b6448fec8
commit 2a533d6f7f
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 0 deletions

View File

@ -317,6 +317,12 @@ async function handleListenConnections(aq: ActiveQuery) {
swarm.off("connection", listener);
aq.respond();
});
swarm.activeRelay.dht.one("close", () => {
swarm.off("connection", listener);
swarm.emit("close");
aq.respond();
});
}
async function handleGetSocketInfo(aq: ActiveQuery) {