chore: decrease goroutine used in core tunnel

This commit is contained in:
wwqgtxx
2023-09-28 18:59:31 +08:00
parent 21fb5f75b8
commit e0458a8fde
42 changed files with 252 additions and 269 deletions

View File

@ -16,7 +16,7 @@ type MultiAddrListener interface {
type InboundListener interface {
Name() string
Listen(tcpIn chan<- ConnContext, udpIn chan<- PacketAdapter, natTable NatTable) error
Listen(tunnel Tunnel) error
Close() error
Address() string
RawAddress() string

10
constant/tunnel.go Normal file
View File

@ -0,0 +1,10 @@
package constant
type Tunnel interface {
// HandleTCPConn will handle a tcp connection blocking
HandleTCPConn(connCtx ConnContext)
// HandleUDPPacket will handle a udp packet nonblocking
HandleUDPPacket(packet PacketAdapter)
// NatTable return nat table
NatTable() NatTable
}