- my ($sort, $name) = @_;
- print "connect $sort $name\n";
+ my ($sort, $line) = @_;
+ dbg('connect', "CONNECT sort: $sort command: $line");
+ if ($sort eq 'net') {
+ # this is a straight network connect
+ my ($host) = $line =~ /host\s+(\w+)/o;
+ my ($port) = $line =~ /port\s+(\d+)/o;
+ $port = 23 if !$port;
+
+ $sock = IO::Socket::INET->new(PeerAddr => "$host", PeerPort => "$port", Proto => 'tcp')
+ or die "Can't connect to $host port $port $!";
+
+ } elsif ($sort eq 'ax25') {
+ my @args = split /\s+/, $line;
+ $pid = open2(\*R, \*W, "$line") or die "can't do $line $!";
+ dbg('connect', "got pid $pid");
+ W->autoflush(1);
+ } else {
+ die "can't get here";
+ }
+ $csort = $sort;