examples/mpd-client: add some code
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user