2024-05-08 21:33:09 -04:00
|
|
|
use cvm12_rs::{guac, qmp};
|
2024-03-28 11:02:14 -04:00
|
|
|
|
2024-05-08 21:33:09 -04:00
|
|
|
use tokio::net::{UnixSocket, UnixStream};
|
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
async fn main() {
|
|
|
|
|
|
|
|
let subscriber = tracing_subscriber::FmtSubscriber::builder()
|
|
|
|
.with_max_level(tracing::Level::TRACE)
|
|
|
|
.finish();
|
|
|
|
|
|
|
|
tracing::subscriber::set_global_default(subscriber).expect("You Banned");
|
|
|
|
|
|
|
|
// This is test code..
|
|
|
|
|
|
|
|
let stream = UnixStream::connect("/home/lily/vms/xpiss/qmp.sock")
|
|
|
|
.await
|
|
|
|
.expect("Could not connect");
|
|
|
|
|
|
|
|
|
|
|
|
let client = qmp::QmpClient::new(stream);
|
|
|
|
|
|
|
|
client.handshake().await.expect("Could not handshake QMP");
|
|
|
|
|
|
|
|
println!("handshook QMP");
|
|
|
|
|
|
|
|
// let's try to get all RESET events
|
|
|
|
let mut rx = client.subscribe_to_event("RESET".into()).await.unwrap();
|
|
|
|
|
|
|
|
while let Some(message) = rx.recv().await {
|
|
|
|
println!("Got event! {:?}", message);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//println!("Hello, world!");
|
2024-03-28 11:02:14 -04:00
|
|
|
}
|