diff options
| author | Yuval Adam <_@yuv.al> | 2018-07-17 23:16:07 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2018-07-17 23:16:07 +0300 |
| commit | 80655a1d70ac56528bab4fbb7290a352ee9fe081 (patch) | |
| tree | 90fbfbb7d1e62b772d4fffcbd7d5fdd3603962da /src/main.rs | |
| parent | c3ea11e82d856817d123ea4a9a9d3576b17817a7 (diff) | |
Second round of refactoring
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 2b4826f..f536d94 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,8 @@ use std::process; use std::thread; use std::sync::mpsc; -use hyper::Server; +use hyper::{Client, Server, Request}; +use hyper::body::Body; use hyper::service::service_fn; use tokio::runtime::Runtime; use futures::Future; @@ -69,6 +70,28 @@ fn main() { let mut rt = Runtime::new().unwrap(); rt.spawn(server); + let client = Client::new(); + + let req = Request::builder() + .method("POST") + .uri("http://10.5.1.201:38400/serviceControl/AVTransport") + .header("Content-Type", "text/xml") + .header("SOAPACTION", notify::A_SET) + .body(Body::from(notify::BODY_SET_URI)) + .unwrap(); + + rt.spawn(client.request(req).map(|res| {}).map_err(|err| {})); + + let req = Request::builder() + .method("POST") + .uri("http://10.5.1.201:38400/serviceControl/AVTransport") + .header("Content-Type", "text/xml") + .header("SOAPACTION", notify::A_PLAY) + .body(Body::from(notify::BODY_PLAY)) + .unwrap(); + + rt.spawn(client.request(req).map(|res| {}).map_err(|err| {})); + // let _udp = thread::spawn(move || { // upnp::discover(); // }); |
