2 # This class is the internal subclass that deals with the internal port 27754
3 # communications for Msg.pm
7 # Copyright (c) 2001 - Dirk Koopman G1TLH
14 use vars qw($VERSION $BRANCH);
15 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
16 $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
17 $main::build += $VERSION;
18 $main::branch += $BRANCH;
28 my ($conn, $msg) = @_;
29 $msg =~ s/([\%\x00-\x1f\x7f-\xff])/sprintf("%%%02X", ord($1))/eg;
30 push (@{$conn->{outqueue}}, $msg . "\n");
37 if ($conn && $conn->{msg} =~ /\cJ/) {
38 my @lines = $conn->{msg} =~ /([^\cM\cJ]*)\cM?\cJ/g;
39 if ($conn->{msg} =~ /\cJ$/) {
42 $conn->{msg} =~ s/([^\cM\cJ]*)\cM?\cJ//g;
46 s/\%([0-9A-F][0-9A-F])/chr(hex($1))/eg;
50 &{$conn->{rproc}}($conn, $_) if exists $conn->{rproc};