1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-29 21:45:21 -05:00

split worker picker from client manager

This commit is contained in:
Darien Raymond
2018-10-24 22:34:48 +02:00
parent 37d1a76139
commit 284923664a
3 changed files with 115 additions and 63 deletions

View File

@@ -72,7 +72,16 @@ func NewHandler(ctx context.Context, config *core.OutboundHandlerConfig) (outbou
if config.Concurrency < 1 || config.Concurrency > 1024 {
return nil, newError("invalid mux concurrency: ", config.Concurrency).AtWarning()
}
h.mux = mux.NewClientManager(proxyHandler, h, config.Concurrency)
h.mux = &mux.ClientManager{
Picker: &mux.IncrementalWorkerPicker{
New: func() (*mux.ClientWorker, error) {
return mux.NewClientWorker(proxyHandler, h, mux.ClientStrategy{
MaxConcurrency: config.Concurrency,
MaxConnection: 128,
})
},
},
}
}
h.proxy = proxyHandler