Set keepalive and tcp_nodelay on underlying sockets

This commit is contained in:
jiangjianfeng
2024-12-05 08:40:20 +00:00
committed by Tate, Hongliang Tian
parent 8b07a68e9e
commit 58cf8ea681
13 changed files with 293 additions and 35 deletions

View File

@ -1,6 +1,9 @@
// SPDX-License-Identifier: MPL-2.0
use aster_bigtcp::{socket::ConnectState, wire::IpEndpoint};
use aster_bigtcp::{
socket::{ConnectState, RawTcpSetOption},
wire::IpEndpoint,
};
use super::{connected::ConnectedStream, init::InitStream};
use crate::{
@ -83,4 +86,11 @@ impl ConnectingStream {
pub(super) fn check_io_events(&self) -> IoEvents {
IoEvents::empty()
}
pub(super) fn set_raw_option<R>(
&mut self,
set_option: impl Fn(&mut dyn RawTcpSetOption) -> R,
) -> R {
set_option(&mut self.bound_socket)
}
}