# $Id$
#
+require 5.004;
# search local then perl directories
BEGIN {
$conn->send_now("Z$call|bye...\n");
}
$stdout->flush if $stdout;
- kill(15, $pid) if $pid;
+ if ($pid) {
+ dbg('connect', "killing $pid");
+ kill(9, $pid);
+ }
sleep(1);
exit(0);
}
{
$SIG{CHLD} = \&sig_chld;
$waitedpid = wait;
+ dbg('connect', "caught $pid");
}
my ($host, $port) = split /\s+/, $line;
$port = 23 if !$port;
- if ($port == 23) {
- $sock = new Net::Telnet (Timeout => $timeout);
+# if ($port == 23) {
+ $sock = new Net::Telnet (Timeout => $timeout, Port => $port);
$sock->option_callback(\&optioncb);
$sock->output_record_separator('');
$sock->option_log('option_log');
$sock->dump_log('dump');
$sock->option_accept(Wont => TELOPT_ECHO);
$sock->open($host) or die "Can't connect to $host port $port $!";
- } else {
- $sock = IO::Socket::INET->new(PeerAddr => "$host:$port", Proto => 'tcp')
- or die "Can't connect to $host port $port $!";
-
- }
+# } else {
+# $sock = IO::Socket::INET->new(PeerAddr => "$host:$port", Proto => 'tcp')
+# or die "Can't connect to $host port $port $!";
+# }
} elsif ($sort eq 'ax25' || $sort eq 'prog') {
my @args = split /\s+/, $line;
$rfh = new IO::File;
sub timeout
{
dbg('connect', "timed out after $timeout seconds");
- cease(10);
+ cease(0);
}
@in = <IN>;
close IN;
- # alarm($timeout);
+ alarm($timeout);
for (@in) {
chomp;