add interface xnet.SrcAddr/DstAddr

This commit is contained in:
ginuerzh
2025-08-03 10:15:53 +08:00
parent 79203e407c
commit f71351f5ef
42 changed files with 518 additions and 295 deletions
+3 -3
View File
@@ -69,13 +69,13 @@ func pipeBuffer(dst io.ReadWriteCloser, src io.ReadWriteCloser, bufferSize int)
if cw, ok := dst.(xio.CloseWrite); ok {
if e := cw.CloseWrite(); e == xio.ErrUnsupported {
dst.Close()
} else {
// Set TCP half-close timeout.
xio.SetReadDeadline(dst, time.Now().Add(tcpWaitTimeout))
}
} else {
dst.Close()
}
// Set TCP half-close timeout.
xio.SetReadDeadline(dst, time.Now().Add(tcpWaitTimeout))
return err
}