You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
882 B
29 lines
882 B
use ssip_client::{ClientName, ClientResult, EventType, NotificationType};
|
|
|
|
fn main() -> ClientResult<()> {
|
|
let mut client =
|
|
ssip_client::new_default_fifo_client(&ClientName::new("joe", "notifications"), None)?;
|
|
client.enable_notification(NotificationType::All).unwrap();
|
|
let msg_id = client.say_line("hello")?;
|
|
println!("message: {}", msg_id);
|
|
loop {
|
|
match client.receive_event() {
|
|
Ok(event) => {
|
|
println!(
|
|
"event {}: message {} client {}",
|
|
event.ntype, event.message, event.client
|
|
);
|
|
if matches!(event.ntype, EventType::End) {
|
|
break;
|
|
}
|
|
}
|
|
Err(err) => {
|
|
eprintln!("error: {:?}", err);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
client.quit()?;
|
|
Ok(())
|
|
}
|