add weight for selector

This commit is contained in:
ginuerzh
2022-09-02 17:23:59 +08:00
parent c643014e12
commit 00f7fa2997
16 changed files with 109 additions and 45 deletions

View File

@ -87,7 +87,7 @@ func (h *tunHandler) Handle(ctx context.Context, conn net.Conn, opts ...handler.
var raddr net.Addr
var err error
target := h.group.Next()
target := h.group.Next(ctx)
if target != nil {
raddr, err = net.ResolveUDPAddr(network, target.Addr)
if err != nil {