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
Transport: Poll Transport directly, remove ListenersStream #2652
Commits on May 16, 2022
-
core/transport: remove Transport::Listener
Remove `Transport::Listener: Stream`. Instead require the Transport itself to implement a stream-like API with `Transport::poll`. In case of multiple listeners, transports are now required to handle the multiple listener streams themselves internally.
-
swarm: remove ListenerStream, poll Transport
Remove ListenersStream, instead poll the boxed transport directly in the `Swarm` for `TransportEvent`s (which replace the former `ListenersEvent`s).
-
transports/tcp: handle transport changes
Add new struct `GenTcpTransport` as wrapper for `GenTcpConfig` to manage multiple listener streams. This is essentially the old ListenerStream logic from swarm/connection.
-
*: adapt majority of other transports
Adapt majority of helper transports to the new Transport trait. For most transports this just removes the extra *Listener type and instead implements that logic in `Transport::poll`. To adapt the `Boxed` transport the restriction had to be added that transport is `Unpin`. TODO: check if we can solve polling `Boxed` without the inner Transport being unpin.
Commits on May 21, 2022
Commits on May 22, 2022
Commits on May 26, 2022
Commits on May 29, 2022
-
With `Transport` becoming non-Clone and having `&mut` self receivers, the `Sync` requirement no longer makes any sense and we can thus remove it.
-
transports/tcp: revert Stream impl for GenTcpTransport
With PR libp2p#2667 the `Sync` trait bound for transport::Boxed is removed. If a tcp transport should be polled as a stream we can now do this via `TcpTransport::new(..)::boxed` and do not need a separate impl of `Stream` for it.
-
-
-
-
-
-
-
-
-
-
-
core/transport: create ListenerId within Transport
Return a ListenerId in Transport::listen_on instead of getting it injected from the outside. Namespace ListenerIds with the Transport's TypeId to avoid clashing IDs when transport generate their ListenerIds independenlty.
Commits on Jun 11, 2022
Commits on Jun 20, 2022
Commits on Jun 26, 2022
Commits on Jun 27, 2022
-
-
Co-authored-by: Max Inden <mail@max-inden.de>
-
-
-
-
-
-
Commits on Jun 28, 2022
-
transports/tcp: rm unneeded dependencies, fix docs
Co-authored-by: Max Inden <mail@max-inden.de>
-
-