1. 解决无法连接服务的问题
2. 解决运行时嵌套的问题 3. 目前已经可以RPC成功了。但是需要debug目录匹配的问题,虚拟目录需要本地处理好
This commit is contained in:
parent
022a31a489
commit
dab0668ac3
|
@ -1,19 +1,41 @@
|
|||
use lws_client::LwsVfsIns;
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let lws_ins = match LwsVfsIns::new("config.json").await{
|
||||
Ok(ins) => ins,
|
||||
Err(e) => {
|
||||
println!("Error creating lws server instance: {:?}", e);
|
||||
return Err(e);
|
||||
}
|
||||
};
|
||||
match lws_ins.hello(){
|
||||
Err(e) => {
|
||||
println!("lws client instance hello err {:?}", e);
|
||||
return Err(e);
|
||||
},
|
||||
_ =>{},
|
||||
}
|
||||
LwsVfsIns::mount(lws_ins)
|
||||
}
|
||||
use lws_client::LwsVfsIns;
|
||||
use std::thread;
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let lws_ins = match LwsVfsIns::new("config.json").await {
|
||||
Ok(ins) => ins,
|
||||
Err(e) => {
|
||||
println!("Error creating lws server instance: {:?}", e);
|
||||
return Err(e);
|
||||
}
|
||||
};
|
||||
println!("start hello process");
|
||||
match lws_ins.hello().await {
|
||||
Err(e) => {
|
||||
println!("lws client instance hello err {:?}", e);
|
||||
return Err(e);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
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")))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
758
src/lib.rs
758
src/lib.rs
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user