multi host client demo
Bind to the same interface as the user supplied client address.
This commit is contained in:
@ -41,6 +41,7 @@ impl AccountantStub {
|
||||
let subscriptions = vec![Subscription::EntryInfo];
|
||||
let req = Request::Subscribe { subscriptions };
|
||||
let data = serialize(&req).expect("serialize Subscribe");
|
||||
trace!("subscribing to {}", self.addr);
|
||||
let _res = self.socket.send_to(&data, &self.addr);
|
||||
}
|
||||
|
||||
@ -114,6 +115,7 @@ impl AccountantStub {
|
||||
pub fn get_last_id(&mut self) -> FutureResult<Hash, ()> {
|
||||
let req = Request::GetLastId;
|
||||
let data = serialize(&req).expect("serialize GetId");
|
||||
assert!(data.len() < 4096);
|
||||
self.socket
|
||||
.send_to(&data, &self.addr)
|
||||
.expect("buffer error");
|
||||
|
Reference in New Issue
Block a user