You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to use a single hyperswarm instance for multiple connections on different topics and want to be able to drop and re-start connections in a granular fashion so I can schedule replication.
@KrishnaPG mentioned a similar question in a previous issue, so forgive me if I've missed the obvious answer there:
Can the swarm.join be called repeatedly multiple times to join different topics, or should different swarm object be created once for each topic? Will duplicate connections to same peer be automatically removed in both cases?
Is it possible for me to use hyperswarm in such a manner at the moment? It seems I can create multiple open connections, but I'm unable to drop a connection once its been opened, which is the behaviour I'd expect after calling swarm.leave(topic). At the moment, when I call swarm.leave(topic) it appears not to drop existing peer connections. Do I need to manually force disconnecting / cancel auto-reconnect with each peer as you mentioned, doing something like...
The swarm internally doesn’t know which incoming connections map to which topic, so unfortunately it’s up for the user to close existing ones when you leave a topic.
Leave stops announcing to the dht and stops connecting to people found on the corresponding topic
I'm attempting to use a single hyperswarm instance for multiple connections on different topics and want to be able to drop and re-start connections in a granular fashion so I can schedule replication.
@KrishnaPG mentioned a similar question in a previous issue, so forgive me if I've missed the obvious answer there:
Is it possible for me to use hyperswarm in such a manner at the moment? It seems I can create multiple open connections, but I'm unable to drop a connection once its been opened, which is the behaviour I'd expect after calling
swarm.leave(topic)
. At the moment, when I callswarm.leave(topic)
it appears not to drop existing peer connections. Do I need to manually force disconnecting / cancel auto-reconnect with each peer as you mentioned, doing something like...my code: https://ledger-git.dyne.org/CoBox/cobox-group-base/src/commit/e6fc3e4ab8668c151cc155d9c43b46485ca3293a/index.js#L79
Thanks!
The text was updated successfully, but these errors were encountered: