Home
last modified time | relevance | path

Searched refs:linger (Results 1 - 6 of 6) sorted by relevance

/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/unix/tcp/
H A Dsocket.rs21 c_int, c_void, linger, socklen_t, AF_INET, AF_INET6, SOCK_STREAM, SOL_SOCKET, SO_LINGER,
103 let mut payload: MaybeUninit<linger> = MaybeUninit::uninit();
104 let mut len = mem::size_of::<linger>() as libc::socklen_t;
114 let linger = unsafe { payload.assume_init() };
115 from_linger(linger)
125 (&payload as *const linger).cast::<c_void>(),
126 mem::size_of::<linger>() as libc::socklen_t,
131 fn from_linger(linger: linger) -> Option<Duration> { in from_linger()
132 if linger in from_linger()
[all...]
H A Dstream.rs121 /// Gets the value of the linger on this socket by getting `SO_LINGER`
131 /// println!("{:?}", stream.linger());
133 pub fn linger(&self) -> io::Result<Option<Duration>> { in linger() functions
137 /// Sets the value of the linger on this socket by setting `SO_LINGER`
152 /// stream.set_linger(None).expect("Sets linger fail.");
154 pub fn set_linger(&self, linger: Option<Duration>) -> io::Result<()> { in set_linger()
155 set_sock_linger(self.get_fd(), linger) in set_linger()
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/windows/tcp/
H A Dsocket.rs139 let linger = unsafe { optval.assume_init() };
140 from_linger(linger)
144 pub(crate) fn set_sock_linger(socket: RawSocket, linger: Option<Duration>) -> io::Result<()> {
145 let optval = into_linger(linger);
160 fn from_linger(linger: LINGER) -> Option<Duration> { in from_linger()
161 if linger.l_onoff == 0 { in from_linger()
164 Some(Duration::from_secs(linger.l_linger as u64)) in from_linger()
168 fn into_linger(linger: Option<Duration>) -> LINGER { in into_linger()
169 match linger { in into_linger()
H A Dstream.rs158 /// Gets the value of the linger on this socket by getting `SO_LINGER`
168 /// println!("{:?}", stream.linger());
170 pub fn linger(&self) -> io::Result<Option<Duration>> { in linger() functions
174 /// Sets the value of the linger on this socket by setting `SO_LINGER`
189 /// stream.set_linger(None).expect("Sets linger fail.");
191 pub fn set_linger(&self, linger: Option<Duration>) -> io::Result<()> { in set_linger()
192 set_sock_linger(self.as_raw_socket(), linger) in set_linger()
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/net/sys/tcp/
H A Dstream.rs356 /// Sets the value of the linger on this socket by setting `SO_LINGER` in fmt()
377 /// stream.set_linger(None).expect("Sets linger fail."); in fmt()
381 pub fn set_linger(&self, linger: Option<Duration>) -> io::Result<()> { in fmt()
382 self.source.set_linger(linger) in fmt()
385 /// Gets the value of the linger on this socket by getting `SO_LINGER` in fmt()
401 /// println!("{:?}", stream.linger()); in fmt()
405 pub fn linger(&self) -> io::Result<Option<Duration>> { in fmt() functions
406 self.source.linger() in fmt()
703 assert!(stream.linger().unwrap().is_none()); in ut_tcp_stream_basic()
705 assert_eq!(stream.linger() in ut_tcp_stream_basic()
[all...]
/commonlibrary/rust/ylong_runtime/ylong_runtime/tests/
H A Dtcp_test.rs136 assert!(stream.linger().unwrap().is_none()); in sdv_tcp_stream_basic()
141 stream.linger().unwrap(), in sdv_tcp_stream_basic()

Completed in 4 milliseconds