net: free inbound TCP sockets more aggressive

This commit is contained in:
eric
2023-03-16 16:54:31 +08:00
parent 048544da79
commit e6d5fbc7c2

View File

@@ -180,6 +180,7 @@ impl TcpListener {
pub async fn accept(&self) -> io::Result<(TcpStream, SocketAddr)> {
let (stream, addr) = self.inner.accept().await?;
apply_socket_opts(&stream)?;
stream.set_linger(Some(Duration::ZERO))?;
Ok((stream, addr))
}
}