Closed Banou26 closed 1 month ago
wtransport::Connection
has open_bi method. Each WebTransport connection (regardless if on client or server) can open a bidirectional stream.
For example:
let endpoint = Endpoint::server(
ServerConfig::builder()
.with_bind_default(4433)
.with_identity(Identity::self_signed(["localhost"]).unwrap())
.build(),
)
.unwrap();
let connection = endpoint
.accept()
.await
.await
.unwrap()
.accept()
.await
.unwrap();
connection.open_bi().await.unwrap();
Note: please be aware quic_connection
(behind feature quinn
) is only there to access underlying QUIC connection (generally you should not need it).
Oohhh, my bad, i literally just noticed that i was running an old version of wtransport, updated it and noticed it was properly exposed now! Sorry about this, and thanks for this amazing library!
Hello
It seems like there's currently no way to open a bidirectional connection from the server side.
incoming_session.await?.quic_connection.open_bi().await?
would be the way to do it if it were to return a(SendStream, RecvStream)
. Butquic_connection
is private andopen_bi
returns aOpenBi<'_>
.I've not found a way while reading through documentation and looking at some of the code, so I'm guessing it's not implemented yet. Is it planned to be?