improve localnet-sanity's robustness (#1160)

* fix poll_gossip_for_leader() loop to actually wait
         for 30 seconds
    * reduce reuseaddr use to only when necessary,
         try to avoid already bound sockets
    * move nat.rs to netutil.rs
    * add gossip tracing to thin_client and bench-tps
This commit is contained in:
Rob Walker
2018-09-09 04:50:43 +09:00
committed by GitHub
parent a77aca75b2
commit 97c3125a78
10 changed files with 200 additions and 63 deletions

View File

@@ -1,11 +1,11 @@
use crdt::{NodeInfo, FULLNODE_PORT_RANGE};
use nat::bind_in_range;
use netutil::bind_in_range;
use std::time::Duration;
use thin_client::ThinClient;
pub fn mk_client(r: &NodeInfo) -> ThinClient {
let requests_socket = bind_in_range(FULLNODE_PORT_RANGE).unwrap();
let transactions_socket = bind_in_range(FULLNODE_PORT_RANGE).unwrap();
let (_, requests_socket) = bind_in_range(FULLNODE_PORT_RANGE).unwrap();
let (_, transactions_socket) = bind_in_range(FULLNODE_PORT_RANGE).unwrap();
requests_socket
.set_read_timeout(Some(Duration::new(1, 0)))