Report the address that failed to bind
This commit is contained in:
parent
63d2b2eb42
commit
8cbaa19d2e
19
src/crdt.rs
19
src/crdt.rs
|
@ -1262,11 +1262,20 @@ impl TestNode {
|
||||||
let mut local_repair_addr = bind_addr;
|
let mut local_repair_addr = bind_addr;
|
||||||
local_repair_addr.set_port(data.contact_info.tvu_window.port());
|
local_repair_addr.set_port(data.contact_info.tvu_window.port());
|
||||||
|
|
||||||
let transaction = UdpSocket::bind(local_transactions_addr).unwrap();
|
fn bind(addr: SocketAddr) -> UdpSocket {
|
||||||
let gossip = UdpSocket::bind(local_gossip_addr).unwrap();
|
match UdpSocket::bind(addr) {
|
||||||
let replicate = UdpSocket::bind(local_replicate_addr).unwrap();
|
Ok(socket) => socket,
|
||||||
let repair = UdpSocket::bind(local_repair_addr).unwrap();
|
Err(err) => {
|
||||||
let requests = UdpSocket::bind(local_requests_addr).unwrap();
|
panic!("Failed to bind to {:?}: {:?}", addr, err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let transaction = bind(local_transactions_addr);
|
||||||
|
let gossip = bind(local_gossip_addr);
|
||||||
|
let replicate = bind(local_replicate_addr);
|
||||||
|
let repair = bind(local_repair_addr);
|
||||||
|
let requests = bind(local_requests_addr);
|
||||||
|
|
||||||
// Responses are sent from the same Udp port as requests are received
|
// Responses are sent from the same Udp port as requests are received
|
||||||
// from, in hopes that a NAT sitting in the middle will route the
|
// from, in hopes that a NAT sitting in the middle will route the
|
||||||
|
|
Loading…
Reference in New Issue