mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-29 17:51:35 +00:00
[tcp] Port-reuse, async-io, if-watch (#1887)
* Update tomls. * Let transports decide when to translate. * Improve tcp transport. * Update stuff. * Remove background task. Enhance documentation. To avoid spawning a background task and thread within `TcpConfig::new()`, with communication via unbounded channels, a `TcpConfig` now keeps track of the listening addresses for port reuse in an `Arc<RwLock>`. Furthermore, an `IfWatcher` is only used by a `TcpListenStream` if it listens on any interface and directly polls the `IfWatcher` both for initialisation and new events. Includes some documentation and test enhancements. * Reintroduce feature flags for tokio vs async-io. To avoid having an extra reactor thread running for tokio users and to make sure all TCP I/O uses the mio-based tokio reactor. Thereby run tests with both backends. * Add missing files. * Fix docsrs attributes. * Update transports/tcp/src/lib.rs Co-authored-by: Max Inden <mail@max-inden.de> * Restore chat-tokio example. * Forward poll_write_vectored for tokio's AsyncWrite. * Update changelogs. Co-authored-by: David Craven <david@craven.ch> Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
@ -74,6 +74,10 @@ where
|
||||
.dial(addr)
|
||||
.map(move |fut| BandwidthFuture { inner: fut, sinks })
|
||||
}
|
||||
|
||||
fn address_translation(&self, server: &Multiaddr, observed: &Multiaddr) -> Option<Multiaddr> {
|
||||
self.inner.address_translation(server, observed)
|
||||
}
|
||||
}
|
||||
|
||||
/// Wraps around a `Stream` that produces connections. Wraps each connection around a bandwidth
|
||||
|
Reference in New Issue
Block a user