ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/AnyEvent-MP/MP/Kernel.pm
(Generate patch)

Comparing cvsroot/AnyEvent-MP/MP/Kernel.pm (file contents):
Revision 1.84 by root, Sun Mar 4 14:28:44 2012 UTC vs.
Revision 1.85 by root, Sun Mar 4 15:12:26 2012 UTC

152 152
153our %RMON; # local ports monitored by remote nodes ($RMON{nodeid}{portid} == cb) 153our %RMON; # local ports monitored by remote nodes ($RMON{nodeid}{portid} == cb)
154our %LMON; # monitored _local_ ports 154our %LMON; # monitored _local_ ports
155 155
156our $GLOBAL; # true if node is a global ("directory") node 156our $GLOBAL; # true if node is a global ("directory") node
157our %LISTENER; 157our %BINDS;
158our $LISTENER; # our listeners, as arrayref 158our $BINDS; # our listeners, as arrayref
159 159
160our $SRCNODE; # holds the sending node _object_ during _inject 160our $SRCNODE; # holds the sending node _object_ during _inject
161 161
162sub _init_names { 162sub _init_names {
163 # ~54 bits, for local port names, lowercase $ID appended 163 # ~54 bits, for local port names, lowercase $ID appended
917 917
918 $binds ||= ["*"]; 918 $binds ||= ["*"];
919 919
920 $WARN->(8, "node $NODE starting up."); 920 $WARN->(8, "node $NODE starting up.");
921 921
922 $LISTENER = []; 922 $BINDS = [];
923 %LISTENER = (); 923 %BINDS = ();
924 924
925 for (map _resolve $_, @$binds) { 925 for (map _resolve $_, @$binds) {
926 for my $bind ($_->recv) { 926 for my $bind ($_->recv) {
927 my ($host, $port) = AnyEvent::Socket::parse_hostport $bind 927 my ($host, $port) = AnyEvent::Socket::parse_hostport $bind
928 or Carp::croak "$bind: unparsable local bind address"; 928 or Carp::croak "$bind: unparsable local bind address";
934 my (undef, $host, $port) = @_; 934 my (undef, $host, $port) = @_;
935 $bind = AnyEvent::Socket::format_hostport $host, $port; 935 $bind = AnyEvent::Socket::format_hostport $host, $port;
936 0 936 0
937 }, 937 },
938 ; 938 ;
939 $LISTENER{$bind} = $listener; 939 $BINDS{$bind} = $listener;
940 push @$LISTENER, $bind; 940 push @$BINDS, $bind;
941 } 941 }
942 } 942 }
943 943
944 db_set "'l" => $NODE => $LISTENER; 944 db_set "'l" => $NODE => $BINDS;
945 945
946 $WARN->(8, "node listens on [@$LISTENER]."); 946 $WARN->(8, "node listens on [@$BINDS].");
947 947
948 # connect to all seednodes 948 # connect to all seednodes
949 set_seeds map $_->recv, map _resolve $_, @$seeds; 949 set_seeds map $_->recv, map _resolve $_, @$seeds;
950 950
951 master_search; 951 master_search;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines