Skip to main content

Module default

Module default 

Source
Expand description

Implement the default transport, which opens TCP connections using a happy-eyeballs style parallel algorithm.

Re-exportsยง

use std::net::SocketAddr; ๐Ÿ”’
use std::time::Duration; ๐Ÿ”’
use async_trait::async_trait; ๐Ÿ”’
use futures::FutureExt; ๐Ÿ”’
use futures::StreamExt; ๐Ÿ”’
use futures::TryFutureExt; ๐Ÿ”’
use futures::stream::FuturesUnordered; ๐Ÿ”’
use safelog::sensitive as sv; ๐Ÿ”’
use tor_error::bad_api_usage; ๐Ÿ”’
use tor_linkspec::ChannelMethod; ๐Ÿ”’
use tor_linkspec::HasChanMethod; ๐Ÿ”’
use tor_linkspec::OwnedChanTarget; ๐Ÿ”’
use tor_proto::peer::PeerAddr; ๐Ÿ”’
use tor_rtcompat::NetStreamProvider; ๐Ÿ”’
use tor_rtcompat::Runtime; ๐Ÿ”’
use tracing::instrument; ๐Ÿ”’
use tracing::instrument; ๐Ÿ”’
use tracing::trace; ๐Ÿ”’
use crate::Error; ๐Ÿ”’
use crate::err::ConnectError; ๐Ÿ”’

Structsยง

DefaultTransport ๐Ÿ”’
A default transport object that opens TCP connections for a ChannelMethod::Direct.

Staticsยง

CONNECTION_DELAY ๐Ÿ”’
Time to wait between starting parallel connections to the same relay.

Functionsยง

connect_to_one ๐Ÿ”’
Connect to one of the addresses in addrs by running connections in parallel until one works.