… | |
… | |
171 | $interval = 0.4 if $interval < 0.4; |
171 | $interval = 0.4 if $interval < 0.4; |
172 | |
172 | |
173 | my @endpoints = reverse @$addresses; |
173 | my @endpoints = reverse @$addresses; |
174 | |
174 | |
175 | $self->{connect_w} = AE::timer 0, $interval * (0.9 + 0.1 * rand), sub { |
175 | $self->{connect_w} = AE::timer 0, $interval * (0.9 + 0.1 * rand), sub { |
176 | my $endpoint = pop @endpoints; |
176 | my $endpoint = pop @endpoints |
|
|
177 | or return $self->transport_error (transport_error => $self->{id}, "unable to connect to any address"); |
177 | |
178 | |
178 | AE::log 9 => "connecting to $self->{id} at $endpoint"; |
179 | AE::log 9 => "connecting to $self->{id} at $endpoint"; |
179 | |
180 | |
180 | $self->{trial}{$endpoint} ||= do { |
181 | $self->{trial}{$endpoint} ||= do { |
181 | my ($host, $port) = AnyEvent::Socket::parse_hostport $endpoint |
182 | my ($host, $port) = AnyEvent::Socket::parse_hostport $endpoint |