1. 解决无法连接服务的问题

2. 解决运行时嵌套的问题
3. 目前已经可以RPC成功了。但是需要debug目录匹配的问题,虚拟目录需要本地处理好
This commit is contained in:
Ekko.bao 2024-07-24 13:19:40 +08:00
parent 022a31a489
commit dab0668ac3
2 changed files with 500 additions and 318 deletions

View File

@ -1,19 +1,41 @@
use lws_client::LwsVfsIns; use lws_client::LwsVfsIns;
#[tokio::main] use std::thread;
async fn main() -> Result<(), Box<dyn std::error::Error>> { #[tokio::main]
let lws_ins = match LwsVfsIns::new("config.json").await{ async fn main() -> Result<(), Box<dyn std::error::Error>> {
Ok(ins) => ins, let lws_ins = match LwsVfsIns::new("config.json").await {
Err(e) => { Ok(ins) => ins,
println!("Error creating lws server instance: {:?}", e); Err(e) => {
return Err(e); println!("Error creating lws server instance: {:?}", e);
} return Err(e);
}; }
match lws_ins.hello(){ };
Err(e) => { println!("start hello process");
println!("lws client instance hello err {:?}", e); match lws_ins.hello().await {
return Err(e); Err(e) => {
}, println!("lws client instance hello err {:?}", e);
_ =>{}, return Err(e);
} }
LwsVfsIns::mount(lws_ins) _ => {}
} }
println!("start mount process");
let handle = thread::spawn(move ||{
match LwsVfsIns::mount(lws_ins) {
Ok(_) => {
Ok::<i32, String>(0)
},
Err(e) => {
println!("mount err {:?}", e);
Ok::<i32, String>(-1)
}
}
});
match handle.join() {
Ok(_) => {
Ok(())
},
Err(e) => {
eprintln!("mount thread start err {:?}", e);
Err(Box::new(std::io::Error::new(std::io::ErrorKind::Other, "mount fail")))
}
}
}

File diff suppressed because it is too large Load Diff