Skip to content
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

webrtc: allow dialing without listening first #4071

Open
thomaseizinger opened this issue Jun 14, 2023 · 0 comments
Open

webrtc: allow dialing without listening first #4071

thomaseizinger opened this issue Jun 14, 2023 · 0 comments

Comments

@thomaseizinger
Copy link
Contributor

thomaseizinger commented Jun 14, 2023

Description

Currently, the WebRTC implementation requires us to establish a listener before we can dial a connection. See

.ok_or(TransportError::Other(Error::NoListeners))?
.

Not only is this a general short-coming of the implementation, it also complicates things in our interop-tests. In particular, we need to do a Swarm::listen_on before we can perform a dial: https://github.com/zvolin/rust-libp2p/blob/3c833dd6e9d1c069826c889e090f3b11cd4ad355/interop-tests/src/lib.rs#L44-L51

This makes the interop-tests for dial-only transports such as webtransport-websys unnecessarily complicated. This is the reason why we need to feature-gate the listening on cfg(target_arch = "wasm32"). Ideally, we would just move the listening to the is_dialer = false branch but due to the above limitation of the WebRTC transport, that is not possible.

For QUIC, we solve this with a dedicated dialer state:

/// Dialer for each socket family if no matching listener exists.
dialer: HashMap<SocketFamily, Dialer>,

Are you planning to do it yourself in a pull request?

No.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant