1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 10:08:15 -05:00
This commit is contained in:
Darien Raymond 2017-01-30 21:37:50 +01:00
parent e7aa920c27
commit 509700eddb
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -76,15 +76,16 @@ func (h *DynamicInboundHandler) waitAnyCloseWorkers(ctx context.Context, cancel
func (h *DynamicInboundHandler) refresh() error {
h.lastRefresh = time.Now()
timeout := time.Minute * time.Duration(h.receiverConfig.AllocationStrategy.GetRefreshValue())
timeout := time.Minute * time.Duration(h.receiverConfig.AllocationStrategy.GetRefreshValue()) * 2
concurrency := h.receiverConfig.AllocationStrategy.GetConcurrencyValue()
ctx, cancel := context.WithTimeout(h.ctx, timeout)
workers := make([]worker, 0, h.receiverConfig.AllocationStrategy.GetConcurrencyValue())
workers := make([]worker, 0, concurrency)
address := h.receiverConfig.Listen.AsAddress()
if address == nil {
address = v2net.AnyIP
}
for i := uint32(0); i < h.receiverConfig.AllocationStrategy.GetConcurrencyValue(); i++ {
for i := uint32(0); i < concurrency; i++ {
port := h.allocatePort()
p, err := proxy.CreateInboundHandler(ctx, h.proxyConfig)
if err != nil {