fn retransmitter(
    sock: Arc<UdpSocket>,
    bank_forks: Arc<RwLock<BankForks>>,
    leader_schedule_cache: &Arc<LeaderScheduleCache>,
    cluster_info: Arc<RwLock<ClusterInfo>>,
    r: BlobReceiver,
) -> JoinHandle<()> {
    let bank_forks = bank_forks.clone();
    let leader_schedule_cache = leader_schedule_cache.clone();
    Builder::new()
        .name("morgan-retransmitter".to_string())
        .spawn(move || {
            trace!("retransmitter started");
            loop {
                if let Err(e) = retransmit(
                    &bank_forks,
                    &leader_schedule_cache,
                    &cluster_info,
                    &r,
                    &sock,
                ) {
                    match e {
                        Error::RecvTimeoutError(RecvTimeoutError::Disconnected) => break,
                        Error::RecvTimeoutError(RecvTimeoutError::Timeout) => (),
                        _ => {
                            inc_new_counter_error!("streamer-retransmit-error", 1, 1);
                        }
                    }
                }
            }
            trace!("exiting retransmitter");
        })
        .unwrap()
}
/// Service to retransmit messages from the leader or layer 1 to relevant peer nodes.
/// See `cluster_info` for network layer definitions.
/// # Arguments
/// * `sock` - Socket to read from.  Read timeout is set to 1.
/// * `exit` - Boolean to signal system exit.
/// * `cluster_info` - This structure needs to be updated and populated by the bank and via gossip.
/// * `recycler` - Blob recycler.
/// * `r` - Receive channel for blobs to be retransmitted to all the layer 1 nodes.
Service to retransmit messages from the leader or layer 1 to relevant peer nodes.
See `cluster_info` for network layer definitions.
Service to retransmit messages from the leader or layer 1 to relevant peer nodes . See ` cluster_info ` for network layer definitions .
fn retransmitter(
    sock: Arc<UdpSocket>,
    bank_forks: Arc<RwLock<BankForks>>,
    leader_schedule_cache: &Arc<LeaderScheduleCache>,
    cluster_info: Arc<RwLock<ClusterInfo>>,
    r: BlobReceiver,
) -> JoinHandle<()> {
    let bank_forks = bank_forks.clone();
    let leader_schedule_cache = leader_schedule_cache.clone();
    Builder::new()
        .name("morgan-retransmitter".to_string())
        .spawn(move || {
            trace!("retransmitter started");
            loop {
                if let Err(e) = retransmit(
                    &bank_forks,
                    &leader_schedule_cache,
                    &cluster_info,
                    &r,
                    &sock,
                ) {
                    match e {
                        Error::RecvTimeoutError(RecvTimeoutError::Disconnected) => break,
                        Error::RecvTimeoutError(RecvTimeoutError::Timeout) => (),
                        _ => {
                            inc_new_counter_error!("streamer-retransmit-error", 1, 1);
                        }
                    }
                }
            }
            trace!("exiting retransmitter");
        })
        .unwrap()
}
fn retransmitter ( sock : Arc < UdpSocket > , bank_forks : Arc < RwLock < BankForks > > , leader_schedule_cache : & Arc < LeaderScheduleCache > , cluster_info : Arc < RwLock < ClusterInfo > > , r : BlobReceiver , ) -> JoinHandle < ( ) > { let bank_forks = bank_forks . clone ( ) ; let leader_schedule_cache = leader_schedule_cache . clone ( ) ; Builder :: new ( ) . name ( " " . to_string ( ) ) . spawn ( move | | { trace ! ( " " ) ; loop { if let Err ( e ) = retransmit ( & bank_forks , & leader_schedule_cache , & cluster_info , & r , & sock , ) { match e { Error :: RecvTimeoutError ( RecvTimeoutError :: Disconnected ) => break , Error :: RecvTimeoutError ( RecvTimeoutError :: Timeout ) => ( ) , _ => { inc_new_counter_error ! ( " " 1 1 ) ; } } } } trace ! ( " " ) ; } ) . unwrap ( ) }
Service to retransmit messages from the leader or layer 1 to relevant peer nodes.
Service to retransmit messages from the leader or layer 1 to relevant peer nodes .
sock
Arc<UdpSocket>
bank_forks
Arc<RwLock<BankForks>>
leader_schedule_cache
&Arc<LeaderScheduleCache>
cluster_info
Arc<RwLock<ClusterInfo>>
r
BlobReceiver
sock
Arc<UdpSocket>
bank_forks
Arc<RwLock<BankForks>>
leader_schedule_cache
&Arc<LeaderScheduleCache>
cluster_info
Arc<RwLock<ClusterInfo>>
r
BlobReceiver