pub fn new(
        rpc_client: Arc<RpcClient>,
        websocket_url: &str,
        config: TpuClientConfig,
    ) -> Result<Self> {
        let exit = Arc::new(AtomicBool::new(false));
        let leader_tpu_service =
            LeaderTpuService::new(rpc_client.clone(), websocket_url, exit.clone())?;

        Ok(Self {
            send_socket: UdpSocket::bind("0.0.0.0:0").unwrap(),
            fanout_slots: config.fanout_slots.min(MAX_FANOUT_SLOTS).max(1),
            leader_tpu_service,
            exit,
            rpc_client,
        })
    }
/// Create a new client that disconnects when dropped
Create a new client that disconnects when dropped
Create a new client that disconnects when dropped
pub fn new(
        rpc_client: Arc<RpcClient>,
        websocket_url: &str,
        config: TpuClientConfig,
    ) -> Result<Self> {
        let exit = Arc::new(AtomicBool::new(false));
        let leader_tpu_service =
            LeaderTpuService::new(rpc_client.clone(), websocket_url, exit.clone())?;
        Ok(Self {
            send_socket: UdpSocket::bind("0.0.0.0:0").unwrap(),
            fanout_slots: config.fanout_slots.min(MAX_FANOUT_SLOTS).max(1),
            leader_tpu_service,
            exit,
            rpc_client,
        })
    }
pub fn new ( rpc_client : Arc < RpcClient > , websocket_url : & str , config : TpuClientConfig , ) -> Result < Self > { let exit = Arc :: new ( AtomicBool :: new ( false ) ) ; let leader_tpu_service = LeaderTpuService :: new ( rpc_client . clone ( ) , websocket_url , exit . clone ( ) ) ? ; Ok ( Self { send_socket : UdpSocket :: bind ( " " ) . unwrap ( ) , fanout_slots : config . fanout_slots . min ( MAX_FANOUT_SLOTS ) . max ( 1 ) , leader_tpu_service , exit , rpc_client , } ) }
Create a new client that disconnects when dropped
Create a new client that disconnects when dropped
rpc_client
Arc<RpcClient>
websocket_url
&str
config
TpuClientConfig