mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 15:36:41 -05:00
add Closable to dispatcher interface
This commit is contained in:
parent
bf8a0b7290
commit
6ff1cfa253
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -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),
|
||||||
|
Loading…
Reference in New Issue
Block a user