--- AnyEvent-MP/MP/Node.pm 2012/02/29 18:44:59 1.54 +++ AnyEvent-MP/MP/Node.pm 2012/02/29 19:23:44 1.55 @@ -114,6 +114,7 @@ my ($self) = @_; return if $self->{transport}; + return if $self->{connect_w}; Scalar::Util::weaken $self; @@ -130,7 +131,7 @@ }; unless (@addresses) { - # on global nodes, all betsa re off now - we either know the node, or we don't + # on global nodes, all bets are off now - we either know the node, or we don't unless ($AnyEvent::MP::Kernel::GLOBAL) { $self->{connect_w} = AnyEvent::MP::Kernel::global_req ( g_find => $self->{id}, @@ -139,6 +140,7 @@ return unless @{ $_[0] }; local $AnyEvent::MP::Kernel::GLOBAL_ADDR->{$self->{id}} = $_[0]; #d# UGLY + delete $self->{connect_w}; $self->connect; } ); @@ -160,7 +162,7 @@ my @endpoints; - $self->{connect_w} = AE::timer 0.050 * rand, $interval * (0.9 + 0.1 * rand), sub { + $self->{connect_w} = AE::timer 0, $interval * (0.9 + 0.1 * rand), sub { @endpoints = @addresses unless @endpoints;