-
Notifications
You must be signed in to change notification settings - Fork 1
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
Have you tried compiling tokio before? Can it run in XP #1
Comments
I tried tokio, need to patch the following API
After the patching is completed, the program can run successfully, but there will be an error, 10022 socket error. I don’t have the energy to investigate the cause for the time being. Other tokio non-networks may be able to take effect. If you have the smallest demo, you can send it to me. See if you can run The projects I tried before used synchronous codes such as reqwest and ureq, and asynchronous ones were not used (including service startup, etc.). In theory, most rust programs can run, and if there are problems, they can be repaired. I used the following example to test use tokio::io::{AsyncWriteExt, AsyncReadExt};
use tokio::net::TcpStream;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut stream = TcpStream::connect("icanhazip.com:80").await?;
let request = "GET / HTTP/1.1\r\nHost: icanhazip.com\r\nConnection: close\r\n\r\n";
stream.write_all(request.as_bytes()).await?;
let mut response = Vec::new();
stream.read_to_end(&mut response).await?;
println!("{}", String::from_utf8_lossy(&response));
Ok(())
} |
Thank you very much. |
After some effort, I've figured out a few things. Tokio and Reqwest rely on Mio for networking, and Mio uses wepoll on Windows. The reason wepoll does not support XP can be seen in the following issue: During debugging, I encountered some issues caused by the following APIs:
The specific code can be seen in So, if you want to use Mio or Reqwest, you must modify the above to work properly. |
Have you tried compiling tokio before? Can it run in XP?
The text was updated successfully, but these errors were encountered: