examples/mpd-client: add some code

This commit is contained in:
2025-12-08 13:00:46 +09:00
parent c5917c9827
commit 58fb7e6263
5 changed files with 17 additions and 7 deletions

View File

@@ -1,3 +1,14 @@
fn main() {
todo!()
use empidee::MpdClient;
#[tokio::main(flavor = "current_thread")]
async fn main() -> anyhow::Result<()> {
let socket = tokio::net::TcpSocket::new_v4()?;
let mut stream = socket.connect("127.0.0.1:6600".parse()?).await?;
let mut client = MpdClient::new(&mut stream);
println!("{}", client.read_initial_mpd_version().await?);
client.play(None).await?;
Ok(())
}