… | |
… | |
154 | my ($self, $portid, $cb) = @_; |
154 | my ($self, $portid, $cb) = @_; |
155 | |
155 | |
156 | my $list = $self->{lmon}{$portid} ||= []; |
156 | my $list = $self->{lmon}{$portid} ||= []; |
157 | |
157 | |
158 | $self->send (["", mon1 => $portid]) |
158 | $self->send (["", mon1 => $portid]) |
159 | unless @$list; |
159 | unless @$list || !length $portid; |
160 | |
160 | |
161 | push @$list, $cb; |
161 | push @$list, $cb; |
162 | } |
162 | } |
163 | |
163 | |
164 | sub unmonitor { |
164 | sub unmonitor { |
… | |
… | |
206 | |
206 | |
207 | # slave nodes are so cool - we can always send to them :) |
207 | # slave nodes are so cool - we can always send to them :) |
208 | |
208 | |
209 | $self->{send} = sub { |
209 | $self->{send} = sub { |
210 | $self->connect; |
210 | $self->connect; |
211 | snd $master, relay => $noderef, @_; |
211 | snd $master, snd => $noderef, @_; |
212 | }; |
212 | }; |
213 | } |
213 | } |
214 | } |
214 | } |
215 | |
215 | |
216 | sub connect { |
216 | sub connect { |