1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-17 13:05:24 +00:00

Refresh rate of a inbound detour allocation

This commit is contained in:
v2ray 2015-12-29 20:52:35 +01:00
parent 71c70416f5
commit e19d8002a8
3 changed files with 13 additions and 2 deletions

View File

@ -30,8 +30,9 @@ const (
)
type InboundDetourAllocationConfig interface {
Strategy() string
Concurrency() int
Strategy() string // Allocation strategy of this inbound detour.
Concurrency() int // Number of handlers (ports) running in parallel.
Refresh() int // Number of seconds before a handler is regenerated.
}
type InboundDetourConfig interface {

View File

@ -12,6 +12,11 @@ import (
type InboundDetourAllocationConfig struct {
StrategyValue string `json:"strategy"`
ConcurrencyValue int `json:"concurrency"`
RefreshSec int `json:"refresh"`
}
func (this *InboundDetourAllocationConfig) Refresh() int {
return this.RefreshSec
}
func (this *InboundDetourAllocationConfig) Strategy() string {

View File

@ -55,6 +55,11 @@ func (this *PortRange) To() v2net.Port {
type InboundDetourAllocationConfig struct {
StrategyValue string
ConcurrencyValue int
RefreshSec int
}
func (this *InboundDetourAllocationConfig) Refresh() int {
return this.RefreshSec
}
func (this *InboundDetourAllocationConfig) Strategy() string {