1
0

prevent system from rebinding UDP socket too early

This commit is contained in:
EAimTY 2023-02-04 16:35:38 +09:00
parent 8cf357012d
commit 41e9489f30
2 changed files with 4 additions and 2 deletions

View File

@ -137,7 +137,10 @@ impl Endpoint {
let conn = if zero_rtt_handshake {
match conn.into_0rtt() {
Ok((conn, _)) => conn,
Err(conn) => conn.await?,
Err(conn) => {
eprintln!("0-RTT handshake failed, fallback to 1-RTT handshake");
conn.await?
}
}
} else {
conn.await?

View File

@ -125,7 +125,6 @@ impl Server {
socket.set_only_v6(!dual_stack)?;
}
socket.set_reuse_address(true)?;
socket.bind(&SockAddr::from(SERVER.get().unwrap().addr))?;
let socket = AssociatedUdpSocket::from((