Comments (6)
The
expect
that produces theQUIC connection parameters must be validated
is a mistake imo - I should be able to handle it. It can fail for numerous runtime reasons - like to routing table for an interface being present. A lot can't be sensibly validated without doing what the fn underexpect
(quinn::Endpoint::connect
) does.
Fixed here: 3b54910
from wtransport.
Hi,
Thank you for reporting this.
I've tried to create a MRE (minimum reproducible example), but with no success.
I've tried the following code, but I understand you probably have multi thread context.
use tracing::error;
use tracing::info;
fn main() {
tracing_subscriber::fmt::init();
let config = wtransport::ClientConfig::builder()
.with_bind_default()
.with_no_cert_validation()
.build();
let rt = tokio::runtime::Runtime::new().expect("Failed building the Runtime");
let _guard = rt.enter();
let endpoint = wtransport::Endpoint::client(config).unwrap();
let t = tokio::spawn(async move {
info!("before wtransport connect");
let _connection = endpoint
.connect("https://localhost:4433")
.await
.inspect_err(|e| {
error!("failed to connect to server: {:?}", e);
})
.unwrap();
info!("Done");
});
rt.block_on(t).unwrap();
}
Would it be possible to have a minimum example I can try to reproduce with?
Thank you!
from wtransport.
I've looked a bit through the code, and I see that this EndpointDriver must be kept around; but I'm not sure what I'm doing wrong
Yeah, it seems the driver task (loop of the QUIC connection) terminated. However, in your snippet of code you are moving the Endpoint
inside the async block, so that makes me think it's more a failure in the driver, and thus it terminates itself.
Probably it is related to the async context and where stuff are created, that's why having a reproducible example would help me a lot
from wtransport.
Thanks for looking into this; I don't really know if it's easy to provide a minimal example that is simple to run.
I ran into it here: https://github.com/cBournhonesque/lightyear/tree/main/examples/simple_box
after I made some changes that means that I create the connection outside of the #[tokio::main]
thread.
I actually found a solution that works for me: using the async_compat
(https://docs.rs/async-compat/latest/async_compat/) crate in combination with a non-tokio runtime works!
Something like:
IoTaskPool::get()
.spawn(Compat::new(async move {
let endpoint = wtransport::Endpoint::client(config)
.inspect_err(|e| error!("could not create endpoint: {:?}", e))
.unwrap();
...
}));
I can try creating a minimal example
from wtransport.
The expect
that produces the QUIC connection parameters must be validated
is a mistake imo - I should be able to handle it. It can fail for numerous runtime reasons - like to routing table for an interface being present. A lot can't be sensibly validated without doing what the fn under expect
(quinn::Endpoint::connect
) does.
from wtransport.
Agreed, gonna fix that
from wtransport.
Related Issues (20)
- New release please HOT 1
- Access to low-level quinn details in client HOT 3
- PrivateKeyNotFound when key already exists. HOT 6
- Please implement the Clone trait for the Identity HOT 1
- Access to low-level `quinn::Connection`
- WebTransport TLS Keying Material Exporter HOT 1
- Feature request: `SessionRequest::remote_address(&self) -> SocketAddr`
- Feature request: `SessionRequest::too_many_requests()`
- Bug report: `Connection::remote_address` returns IPv6 addresses despite using IPv4 HOT 5
- Firefox support HOT 5
- The `with_server_certificate_hashes` on the *client* should not be under a feature flag HOT 5
- Expose the server certificate hashes cert verifier for external use
- Is there a reason to have separate client and server endpoints? HOT 4
- Allow assigning fields at `ClientConfig` HOT 3
- wtransport for IOS & Android?
- `SendStream::stopped` requires move
- looping over RecvStream::read causes an infinite loop without the client sending anything. HOT 10
- Make receive_datagram return BytesMut HOT 4
- Version 0.1.13 does not build without default features HOT 1
- Wrong model for stream error codes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wtransport.