put duplicate checking into respective modules and out of DXProt.
[spider.git] / perl / client.pl
index bc2d46c7f9b2e322b55275f1991b91fd51133e8b..f59c5847c09be00f2cb481be4387331899a2a92d 100755 (executable)
@@ -46,14 +46,13 @@ use Net::Telnet qw(TELOPT_ECHO);
 use IO::File;
 use IO::Socket;
 use IPC::Open2;
-use Carp qw{cluck};
 
 # cease communications
 sub cease
 {
        my $sendz = shift;
        if ($conn && $sendz) {
-               $conn->send_now("Z$call|bye...\n");
+               $conn->send_now("Z$call|bye...");
                sleep(1);
        }
        $stdout->flush if $stdout;
@@ -103,7 +102,7 @@ sub rec_socket
                cease(1);
        }
        if (defined $msg) {
-               my ($sort, $call, $line) = $msg =~ /^(\w)([A-Z0-9\-]+)\|(.*)$/;
+               my ($sort, $call, $line) = $msg =~ /^(\w)([^\|]+)\|(.*)$/;
                
                if ($sort eq 'D') {
                        my $snl = $mynl;
@@ -148,7 +147,13 @@ sub rec_socket
                        $buffered = $line;      # set buffered or unbuffered
                } elsif ($sort eq 'Z') { # end, disconnect, go, away .....
                        cease(0);
-               }         
+               } 
+
+               # ******************************************************
+               # ******************************************************
+               # any other sorts that might happen are silently ignored.
+               # ******************************************************
+               # ******************************************************
        }
        $lasttime = time; 
 }