… | |
… | |
340 | my %client_ports; |
340 | my %client_ports; |
341 | |
341 | |
342 | $chatter_port->rcv (join => sub { |
342 | $chatter_port->rcv (join => sub { |
343 | my ($chatter_port, $type, $client_port) = @_; |
343 | my ($chatter_port, $type, $client_port) = @_; |
344 | |
344 | |
|
|
345 | print "got new client port: $client_port\n"; |
|
|
346 | |
345 | $client_ports{$client_port} = 1; |
347 | $client_ports{$client_port} = 1; |
346 | 0 |
348 | 0 |
347 | }); |
349 | }); |
348 | |
350 | |
349 | $chatter_port->rcv (message => sub { |
351 | $chatter_port->rcv (message => sub { |
350 | my ($chatter_port, $type, $msg) = @_; |
352 | my ($chatter_port, $type, $msg) = @_; |
|
|
353 | |
|
|
354 | print "message> $msg\n"; |
351 | |
355 | |
352 | snd $_, message => $msg for keys %client_ports; |
356 | snd $_, message => $msg for keys %client_ports; |
353 | 0 |
357 | 0 |
354 | }); |
358 | }); |
355 | |
359 | |