Use greetd TokioCodec for server example
This commit is contained in:
parent
3b6cabf4ed
commit
2757e65468
1 changed files with 3 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
use greetd_ipc::{codec::SyncCodec, AuthMessageType, ErrorType, Request, Response};
|
use greetd_ipc::{codec::TokioCodec, AuthMessageType, ErrorType, Request, Response};
|
||||||
use std::{env, fs, io, thread};
|
use std::{env, fs, io, thread};
|
||||||
use tokio::net::UnixListener;
|
use tokio::net::UnixListener;
|
||||||
|
|
||||||
|
|
@ -41,7 +41,7 @@ async fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut cursor = io::Cursor::new(bytes);
|
let mut cursor = io::Cursor::new(bytes);
|
||||||
Request::read_from(&mut cursor).unwrap()
|
Request::read_from(&mut cursor).await.unwrap()
|
||||||
};
|
};
|
||||||
println!("{:?}", request);
|
println!("{:?}", request);
|
||||||
|
|
||||||
|
|
@ -64,7 +64,7 @@ async fn main() {
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut bytes = Vec::with_capacity(4096);
|
let mut bytes = Vec::with_capacity(4096);
|
||||||
response.write_to(&mut bytes).unwrap();
|
response.write_to(&mut bytes).await.unwrap();
|
||||||
socket.try_write(&bytes).unwrap();
|
socket.try_write(&bytes).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue