/// main function. start the endpoint listening.
main function. start the endpoint listening.
main function . start the endpoint listening .
pub async fn start(
    transport: &TransportType,
    addr: SocketAddr,
) -> Result<(Sender<TransportSendMessage>, Receiver<TransportRecvMessage>)> {
    let (send_send, send_recv) = new_transport_send_channel();
    let (recv_send, recv_recv) = new_transport_recv_channel();
    match transport {
        //&TransportType::UDP => udp::UdpEndpoint::start(addr, recv_send, send_recv).await?,
        &TransportType::TCP => tcp::start(addr, recv_send, send_recv).await?,
        &TransportType::QUIC => quic::start(addr, recv_send, send_recv).await?,
        _ => panic!("Not suppert, waiting"),
    }
    Ok((send_send, recv_recv))
}
pub async fn start ( transport : & TransportType , addr : SocketAddr , ) -> Result < ( Sender < TransportSendMessage > , Receiver < TransportRecvMessage > ) > { let ( send_send , send_recv ) = new_transport_send_channel ( ) ; let ( recv_send , recv_recv ) = new_transport_recv_channel ( ) ; match transport { //&TransportType::UDP => udp::UdpEndpoint::start(addr, recv_send, send_recv).await?, & TransportType :: TCP => tcp :: start ( addr , recv_send , send_recv ) . await ? , & TransportType :: QUIC => quic :: start ( addr , recv_send , send_recv ) . await ? , _ => panic ! ( " " ) , } Ok ( ( send_send , recv_recv ) ) }
main function.
main function .
transport
&TransportType
addr
SocketAddr