Skip to content

Simplified handling of idle connections #4306

@thomaseizinger

Description

@thomaseizinger

Description

For a longer discussion see #3353 (comment).

With #3844, we are deprecating KeepAlive::Until. With #4121, users can configure a Swarm-wide idle timeout that activates once all ConnectionHandlers report KeepAlive::No.

- [ ] https://github.com/libp2p/rust-libp2p/issues/3844
- [ ] https://github.com/libp2p/rust-libp2p/issues/4121
- [ ] https://github.com/libp2p/rust-libp2p/pull/4559
- [ ] https://github.com/libp2p/rust-libp2p/issues/4520
- [x] swarm: Make `ConnectionHandler::connection_keep_alive` optional and default to `KeepAlive::No`
- [x] Consider removing `KeepAlive` in favor of a boolean

Motivation

Easier idle connection management for custom protocols. In particular, most users should not need to deal with idle connections and keep alive tracking but it should just work out of the box.

Metadata

Metadata

Assignees

No one assigned

    Labels

    tracking-issueIssues which are the entry point to bigger projects.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions