use constant instead of magic number

This commit is contained in:
Michael Stapelberg 2010-03-22 21:42:35 +01:00
parent 460f09915f
commit 4ba7259f6a
1 changed files with 2 additions and 1 deletions

View File

@ -167,7 +167,8 @@ sub subscribe {
my ($self, $callbacks) = @_; my ($self, $callbacks) = @_;
my $payload = encode_json [ keys %{$callbacks} ]; my $payload = encode_json [ keys %{$callbacks} ];
my $message = $magic . pack("LL", length($payload), 2) . $payload; my $len = length($payload);
my $message = $magic . pack("LL", $len, TYPE_SUBSCRIBE) . $payload;
$self->{ipchdl}->push_write($message); $self->{ipchdl}->push_write($message);
# Register callbacks for each message type # Register callbacks for each message type