pub async fn connect_with_config<Tx, Rx, App>(
socket: Socket<Tx, Rx>,
host: Option<&str>,
params: &ConnectionParams<'_>,
app: App,
) -> QuicResult<QuicConnection>where
Tx: DatagramSocketSend + Send + 'static,
Rx: DatagramSocketRecv + Unpin + 'static,
App: ApplicationOverQuic,
Expand description
Connects to a QUIC server using socket
and the provided
ApplicationOverQuic
.
When the future resolves, the connection has completed its handshake and
app
is running in the worker task. In case the handshake failed, we close
the connection automatically and the future will resolve with an error.
ยงNote
tokio-quiche currently only supports one client connection per socket. Sharing a socket among multiple connections will lead to lost packets as both connections try to read from the shared socket.