You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using monoio with s2n_quic and when i wanted to start the server this error showed up:
Error: StartError(there is no reactor running, must be called from the context of a Tokio 1.x runtime)
My code:
use s2n_quic::Server;
use std::error::Error;
use monoio;
#[monoio::main]
async fn main() -> Result<(), Box<dyn Error>> {
println!("start ecexc");
let mut server = Server::builder()
.with_io("127.0.0.1:4433")?
.start()?;
println!("end");
while let Some(mut connection) = server.accept().await {
monoio::spawn(async move {
while let Ok(Some(mut stream)) = connection.accept_bidirectional_stream().await {
monoio::spawn(async move {
while let Ok(Some(data)) = stream.receive().await {
stream.send(data).await.expect("stream should be open");
}
});
}
});
}
Ok(())
}
The text was updated successfully, but these errors were encountered:
I am using monoio with s2n_quic and when i wanted to start the server this error showed up:
Error: StartError(there is no reactor running, must be called from the context of a Tokio 1.x runtime)
My code:
The text was updated successfully, but these errors were encountered: