1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-03 00:36:30 -05:00

add Closable to dispatcher interface

This commit is contained in:
Shelikhoo 2021-12-11 23:05:19 +00:00 committed by Xiaokang Wang (Shelikhoo)
parent bf8a0b7290
commit 6ff1cfa253
2 changed files with 6 additions and 0 deletions

View File

@ -2,10 +2,12 @@ package udp
import (
"context"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/buf"
"github.com/v2fly/v2ray-core/v5/common/net"
)
type DispatcherI interface {
common.Closable
Dispatch(ctx context.Context, destination net.Destination, payload *buf.Buffer)
}

View File

@ -32,6 +32,10 @@ type Dispatcher struct {
callback ResponseCallback
}
func (v *Dispatcher) Close() error {
return nil
}
func NewSplitDispatcher(dispatcher routing.Dispatcher, callback ResponseCallback) DispatcherI {
return &Dispatcher{
conns: make(map[net.Destination]*connEntry),