pub fn new_client(
        node_id: NodeId,
        conn: Pin<Box<quiche::Connection>>,
        current_link: &Weak<Link>,
        link_status_observer: Observer<Vec<LinkStatus>>,
        service_observer: Observer<Vec<String>>,
    ) -> Result<Rc<Self>, Error> {
        let (command_sender, command_receiver) = futures::channel::mpsc::channel(1);
        let p = Self::new_instance(
            node_id,
            conn,
            Endpoint::Client,
            current_link,
            Some(command_sender.clone()),
        )?;
        let (conn_stream_writer, conn_stream_reader) = p.conn.bind_id(0);
        spawn(log_errors(
            client_conn_stream(
                node_id,
                conn_stream_writer,
                conn_stream_reader,
                command_receiver,
                service_observer,
                p.conn_stats.clone(),
            ),
            "Client connection stream failed",
        ));
        spawn(log_errors(
            send_links(node_id, command_sender, link_status_observer),
            "Sending initial link data failed",
        ));
        Ok(p)
    }
/// Construct a new client peer - spawns tasks to handle making control stream requests, and
/// publishing link metadata
Construct a new client peer - spawns tasks to handle making control stream requests, and
publishing link metadata
Construct a new client peer - spawns tasks to handle making control stream requests and publishing link metadata
pub fn new_client(
        node_id: NodeId,
        conn: Pin<Box<quiche::Connection>>,
        current_link: &Weak<Link>,
        link_status_observer: Observer<Vec<LinkStatus>>,
        service_observer: Observer<Vec<String>>,
    ) -> Result<Rc<Self>, Error> {
        let (command_sender, command_receiver) = futures::channel::mpsc::channel(1);
        let p = Self::new_instance(
            node_id,
            conn,
            Endpoint::Client,
            current_link,
            Some(command_sender.clone()),
        )?;
        let (conn_stream_writer, conn_stream_reader) = p.conn.bind_id(0);
        spawn(log_errors(
            client_conn_stream(
                node_id,
                conn_stream_writer,
                conn_stream_reader,
                command_receiver,
                service_observer,
                p.conn_stats.clone(),
            ),
            "Client connection stream failed",
        ));
        spawn(log_errors(
            send_links(node_id, command_sender, link_status_observer),
            "Sending initial link data failed",
        ));
        Ok(p)
    }
pub fn new_client ( node_id : NodeId , conn : Pin < Box < quiche :: Connection > > , current_link : & Weak < Link > , link_status_observer : Observer < Vec < LinkStatus > > , service_observer : Observer < Vec < String > > , ) -> Result < Rc < Self > , Error > { let ( command_sender , command_receiver ) = futures :: channel :: mpsc :: channel ( 1 ) ; let p = Self :: new_instance ( node_id , conn , Endpoint :: Client , current_link , Some ( command_sender . clone ( ) ) , ) ? ; let ( conn_stream_writer , conn_stream_reader ) = p . conn . bind_id ( 0 ) ; spawn ( log_errors ( client_conn_stream ( node_id , conn_stream_writer , conn_stream_reader , command_receiver , service_observer , p . conn_stats . clone ( ) , ) , " " , ) ) ; spawn ( log_errors ( send_links ( node_id , command_sender , link_status_observer ) , " " , ) ) ; Ok ( p ) }
Construct a new client peer - spawns tasks to handle making control stream requests, and
publishing link metadata
Construct a new client peer - spawns tasks to handle making control stream requests and publishing link metadata
node_id
NodeId
conn
Pin<Box<quiche::Connection>>
current_link
&Weak<Link>
link_status_observer
Observer<Vec<LinkStatus>>
service_observer
Observer<Vec<String>>
node_id
NodeId
conn
Pin<Box<quiche::Connection>>
current_link
&Weak<Link>
link_status_observer
Observer<Vec<LinkStatus>>
service_observer
Observer<Vec<String>>