Skip to content

Conversation

@jhiatt-verkada
Copy link
Contributor

This depends on a new crate introduced by moq-dev/web-transport#138 .

This is only for convenience in developing with cross-repo deps.
We'll get a cleaner diff when we add another connection method to
the struct in a future commit.
If desired, use Client::connect_with_fallback() to use a
WebSocket-based transport when the QUIC connection fails. The
logic mirrors the TypeScript implementation by affording the
QUIC codepath a small (configurable) headstart.
self.connect_quic(url).await
}

pub async fn connect_with_fallback(&self, url: Url) -> anyhow::Result<WebTransportSessionAny> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if instead of WebTransportSessionAny, we could return an enum for Quinn or WebSocket. moq_lite is generic over both of these so it would be faster than doing an enum dispatch.

env = "MOQ_CLIENT_WEBSOCKET_DELAY",
default_value = "200ms"
)]
#[serde(deserialize_with = "deserialize_humantime")]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants