Skip to content

How to combine QUIC and relay client transports? #3653

Closed Answered by mycognosist
mycognosist asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the swift assistance, @thomaseizinger.

Trying your first suggestion (converting the Option<relay_transport> to a Toggle) results in a "trait bounds not satisfied" error:

let (relay_transport, relay_client) = if network_config.relay_client {
    let (relay_transport, relay_client) = relay::client::new(key_pair.public().to_peer_id());
    (Some(relay_transport), Some(relay_client))
} else {
    (None, None)
};

let quic_transport = quic::tokio::Transport::new(quic_config)
    .map(|(p, c), _| (p, StreamMuxerBox::new(c)))
    .boxed();

let relay_transport = Toggle::from(relay_transport);

let transport = OrTransport::new(relay_transport, quic_transport)
    .map(|either_output, _| 

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@thomaseizinger
Comment options

@mycognosist
Comment options

Answer selected by mycognosist
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants