62 |
|
|
63 |
my $session; |
my $session; |
64 |
|
|
65 |
|
sub to_all { |
66 |
|
my $data = shift; |
67 |
|
foreach my $port ( keys %{ $session->{port} } ) { |
68 |
|
warn ">>>> [$port]\n"; |
69 |
|
Storable::store_fd( $data, $session->{port}->{$port} ); |
70 |
|
} |
71 |
|
} |
72 |
|
|
73 |
while (1) { |
while (1) { |
74 |
for my $sock ($sel->can_read(1)) { |
for my $sock ($sel->can_read(1)) { |
75 |
if ($sock == $lsn) { |
if ($sock == $lsn) { |
91 |
if ( $data->{repl} ) { |
if ( $data->{repl} ) { |
92 |
my $response = { repl => $$ }; |
my $response = { repl => $$ }; |
93 |
if ( $data->{repl} =~ m/ping/ ) { |
if ( $data->{repl} =~ m/ping/ ) { |
94 |
foreach my $port ( keys %{ $session->{port} } ) { |
to_all { ping => 1 }; |
|
warn ">>>> [$port]\n"; |
|
|
Storable::store_fd( { ping => 1 }, $session->{port}->{$port} ); |
|
|
} |
|
95 |
} elsif ( $data->{repl} =~ m/info/ ) { |
} elsif ( $data->{repl} =~ m/info/ ) { |
96 |
$response->{info} = $info; |
$response->{info} = $info; |
97 |
} |
} |