Browse Source

add Closable to dispatcher interface

Shelikhoo 4 years ago
parent
commit
6ff1cfa253

+ 2 - 0
transport/internet/udp/dispatcher.go

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

+ 4 - 0
transport/internet/udp/dispatcher_split.go

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