replace xnet.Transport by xnet.Pipe

This commit is contained in:
ginuerzh
2025-07-28 20:52:15 +08:00
parent 35a049fb03
commit 208d18125c
52 changed files with 468 additions and 104 deletions
+15
View File
@@ -4,6 +4,7 @@ import (
"bytes"
"net"
xio "github.com/go-gost/x/internal/io"
"github.com/shadowsocks/go-shadowsocks2/core"
)
@@ -40,3 +41,17 @@ func (c *shadowConn) Write(b []byte) (n int, err error) {
_, err = c.Conn.Write(b)
return
}
func (c *shadowConn) CloseRead() error {
if sc, ok := c.Conn.(xio.CloseRead); ok {
return sc.CloseRead()
}
return nil
}
func (c *shadowConn) CloseWrite() error {
if sc, ok := c.Conn.(xio.CloseWrite); ok {
return sc.CloseWrite()
}
return nil
}