fix #1079
* move gossip/NCP off assuming anything about its address * use a single socket to send and receive gossip * remove --addr/-a from CLIs * rearrange networking utility code * use Arc<UdpSocket> to share the Sync-safe UdpSocket among threads * rename TestNode to Node TODO: * re-enable 127.0.0.1 as a valid address in crdt * change repair request/response to a similar, single socket * pick cloned sockets or Arc<UdpSocket> for all these (rpu uses tryclone()) * update contact_info with network truthiness instead of what the node says?
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
use crdt::NodeInfo;
|
||||
use nat::udp_random_bind;
|
||||
use crdt::{NodeInfo, GOSSIP_PORT_RANGE};
|
||||
use nat::bind_in_range;
|
||||
use std::time::Duration;
|
||||
use thin_client::ThinClient;
|
||||
|
||||
pub fn mk_client(r: &NodeInfo) -> ThinClient {
|
||||
let requests_socket = udp_random_bind(8000, 10000, 5).unwrap();
|
||||
let transactions_socket = udp_random_bind(8000, 10000, 5).unwrap();
|
||||
let requests_socket = bind_in_range(GOSSIP_PORT_RANGE).unwrap();
|
||||
let transactions_socket = bind_in_range(GOSSIP_PORT_RANGE).unwrap();
|
||||
|
||||
requests_socket
|
||||
.set_read_timeout(Some(Duration::new(1, 0)))
|
||||
|
Reference in New Issue
Block a user