Fix examples

This commit is contained in:
Tim Kuehn
2016-02-24 23:33:03 -08:00
parent c398e2389b
commit 9827f75459
2 changed files with 4 additions and 3 deletions

View File

@@ -47,7 +47,7 @@ impl HelloService for HelloServer {
fn main() {
let server_handle = HelloServer.spawn("0.0.0.0:0").unwrap();
let client = hello_service::Client::new(server_handle.local_addr()).unwrap();
let client = hello_service::Client::new(server_handle.dialer()).unwrap();
assert_eq!("Hello, Mom!", client.hello("Mom".into()).unwrap());
drop(client);
server_handle.shutdown();

View File

@@ -41,8 +41,9 @@ mod benchmark {
Arc::new(Mutex::new(handle))
};
static ref CLIENT: Arc<Mutex<AsyncClient>> = {
let addr = HANDLE.lock().unwrap().local_addr().clone();
let client = AsyncClient::new(addr).unwrap();
let lock = HANDLE.lock().unwrap();
let dialer = lock.dialer();
let client = AsyncClient::new(dialer).unwrap();
Arc::new(Mutex::new(client))
};
}