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

Comparing AnyEvent-MP/MP/Base.pm (file contents):
Revision 1.5 by root, Mon Aug 3 21:35:03 2009 UTC vs.
Revision 1.6 by root, Mon Aug 3 22:05:55 2009 UTC

18 18
19=cut 19=cut
20 20
21package AnyEvent::MP::Base; 21package AnyEvent::MP::Base;
22 22
23use common::sense;
24use Carp ();
25use MIME::Base64 ();
26
27use AE ();
28
23use AnyEvent::MP::Node; 29use AnyEvent::MP::Node;
24use AnyEvent::MP::Transport; 30use AnyEvent::MP::Transport;
25
26use common::sense;
27
28use Carp ();
29
30use AE ();
31 31
32use base "Exporter"; 32use base "Exporter";
33 33
34our $VERSION = '0.01'; 34our $VERSION = '0.01';
35our @EXPORT = qw( 35our @EXPORT = qw(
83 } 83 }
84 84
85 $DEFAULT_SECRET 85 $DEFAULT_SECRET
86} 86}
87 87
88sub gen_uniq {
89 my $uniq = pack "wN", $$, time;
90 $uniq = MIME::Base64::encode_base64 $uniq, "";
91 $uniq =~ s/=+$//;
92 $uniq
93}
94
88our $UNIQ = sprintf "%x.%x", $$, time; # per-process/node unique cookie 95our $UNIQ = gen_uniq; # per-process/node unique cookie
89our $ID = "a"; 96our $ID = "a";
90our $PUBLIC = 0; 97our $PUBLIC = 0;
91our $NODE = $$; 98our $NODE = $$;
92our $PORT; 99our $PORT;
93 100

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines