refactor: connection manager

This commit is contained in:
世界
2024-11-20 11:32:02 +08:00
parent 285a82050c
commit fd299a0961
11 changed files with 569 additions and 52 deletions

14
adapter/connections.go Normal file
View File

@@ -0,0 +1,14 @@
package adapter
import (
"context"
"net"
N "github.com/sagernet/sing/common/network"
)
type ConnectionManager interface {
Lifecycle
NewConnection(ctx context.Context, this N.Dialer, conn net.Conn, metadata InboundContext, onClose N.CloseHandlerFunc)
NewPacketConnection(ctx context.Context, this N.Dialer, conn N.PacketConn, metadata InboundContext, onClose N.CloseHandlerFunc)
}