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
@@ -9,6 +9,7 @@ import (
"github.com/go-gost/core/metadata"
"github.com/go-gost/core/observer/stats"
xio "github.com/go-gost/x/internal/io"
xnet "github.com/go-gost/x/internal/net"
"github.com/go-gost/x/internal/net/udp"
)
@@ -89,6 +90,20 @@ func (c *conn) ClientAddr() net.Addr {
return nil
}
func (c *conn) CloseRead() error {
if sc, ok := c.Conn.(xio.CloseRead); ok {
return sc.CloseRead()
}
return nil
}
func (c *conn) CloseWrite() error {
if sc, ok := c.Conn.(xio.CloseWrite); ok {
return sc.CloseWrite()
}
return nil
}
type packetConn struct {
net.PacketConn
stats stats.Stats