mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-04-21 13:09:11 -04:00
add exponential backoff as retry logic
This commit is contained in:
@@ -79,7 +79,7 @@ func (this *FreedomConnection) Dispatch(destination v2net.Destination, payload *
|
||||
if this.domainStrategy == Config_USE_IP && destination.Address.Family().IsDomain() {
|
||||
destination = this.ResolveIP(destination)
|
||||
}
|
||||
err := retry.Timed(5, 100).On(func() error {
|
||||
err := retry.ExponentialBackoff(5, 100).On(func() error {
|
||||
rawConn, err := internet.Dial(this.meta.Address, destination, this.meta.GetDialerOptions())
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -44,7 +44,7 @@ func (this *Client) Dispatch(destination v2net.Destination, payload *alloc.Buffe
|
||||
var server *protocol.ServerSpec
|
||||
var conn internet.Connection
|
||||
|
||||
err := retry.Timed(5, 100).On(func() error {
|
||||
err := retry.ExponentialBackoff(5, 100).On(func() error {
|
||||
server = this.serverPicker.PickServer()
|
||||
dest := server.Destination()
|
||||
dest.Network = network
|
||||
|
||||
@@ -33,7 +33,7 @@ func (this *VMessOutboundHandler) Dispatch(target v2net.Destination, payload *al
|
||||
var rec *protocol.ServerSpec
|
||||
var conn internet.Connection
|
||||
|
||||
err := retry.Timed(5, 100).On(func() error {
|
||||
err := retry.ExponentialBackoff(5, 100).On(func() error {
|
||||
rec = this.serverPicker.PickServer()
|
||||
rawConn, err := internet.Dial(this.meta.Address, rec.Destination(), this.meta.GetDialerOptions())
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user