Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swarm: add ListenClose #1586

Merged
merged 3 commits into from
Jun 5, 2022
Merged

swarm: add ListenClose #1586

merged 3 commits into from
Jun 5, 2022

Conversation

birros
Copy link
Contributor

@birros birros commented Jun 1, 2022

Recreating libp2p/go-libp2p-swarm#319.

Add the missing ListenClose method, as it is impossible to close existing listeners.

Useful in many situations, especially on systems that no longer handle listeners after the operating system has suspended them without closing them, when applications run in the background for example (iOS).

This offers the possibility to update the network listener without completely restarting the swarm.

I think this method should also be added to the network interface.

The decision is yours

p2p/net/swarm/swarm_listen.go Outdated Show resolved Hide resolved
p2p/net/swarm/swarm_listen.go Outdated Show resolved Hide resolved
p2p/net/swarm/swarm_listen.go Show resolved Hide resolved
p2p/net/swarm/swarm_listen.go Show resolved Hide resolved
@birros birros requested a review from Stebalien June 3, 2022 10:41
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. One nit, but I don't feel strongly about it.

p2p/net/swarm/swarm_listen.go Outdated Show resolved Hide resolved
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Stebalien
Copy link
Member

@marten-seemann LGTM, but I'll leave it up to you to merge.

@marten-seemann marten-seemann merged commit d7ba372 into libp2p:master Jun 5, 2022
@birros birros deleted the feat/add-listen-close branch June 6, 2022 09:48
MarcoPolo pushed a commit that referenced this pull request Jun 24, 2022
* feat(swarm): add ListenClose

* fix(swarm): fix ListenClose behavior

* refactor(swarm): move the listener's closing log
@MarcoPolo MarcoPolo mentioned this pull request Jul 7, 2022
41 tasks
@ajnavarro ajnavarro mentioned this pull request Aug 24, 2022
72 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants