Skip to content

Commit c6e0af3

Browse files
committed
TCP socket timeout in 7200s following Linux's setting
1 parent 8ab8e29 commit c6e0af3

File tree

1 file changed

+2
-0
lines changed
  • crates/shadowsocks-service/src/local/tun

1 file changed

+2
-0
lines changed

crates/shadowsocks-service/src/local/tun/tcp.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,8 @@ impl TcpTun {
387387
TcpSocketBuffer::new(vec![0u8; send_buffer_size as usize]),
388388
);
389389
socket.set_keep_alive(accept_opts.tcp.keepalive.map(From::from));
390+
// FIXME: This should follows system's setting. 7200 is Linux's default.
391+
socket.set_timeout(Some(Duration::from_secs(7200)));
390392

391393
if let Err(err) = socket.listen(dst_addr) {
392394
return Err(io::Error::new(ErrorKind::Other, err));

0 commit comments

Comments
 (0)