# An instance of this is setup by a command together with a load
# of callbacks and then runs with a state machine until completion
#
-# $Id$
+#
#
# Copyright (c) 2001 - Dirk Koopman G1TLH
#
use DXVars;
use DXUtil;
use DXDebug;
+use DXTimer;
+
use IO::File;
use IO::Socket;
use IPC::Open3;
my $conn = shift;
my $msg;
- if ($conn->{csort} eq 'ax25' && exists $conn->{msg}) {
+ if ($conn->ax25 && exists $conn->{msg}) {
$conn->{msg} =~ s/\cM/\cJ/g;
}
$conn->{msg} =~ s/([^\cM\cJ]*)\cM?\cJ//g;
}
+ $conn->{linesin} += @lines;
+ $Msg::total_lines_in += @lines;
while (defined ($msg = shift @lines)) {
dbg("connect $conn->{cnum}: $msg") if $conn->{state} ne 'C' && isdbg('connect');
}
}
-sub to_connected
-{
- my ($conn, $call, $dir, $sort) = @_;
- $conn->{state} = 'C';
- $conn->conns($call);
- delete $conn->{cmd};
- $conn->{timeout}->del if $conn->{timeout};
- delete $conn->{timeout};
- $conn->nolinger;
- &{$conn->{rproc}}($conn, "$dir$call|$sort");
-}
-
-
sub start_connect
{
my $call = shift;
dbg("connect $conn->{cnum}: timeout set to $val") if isdbg('connect');
$conn->{timeout}->del if $conn->{timeout};
$conn->{timeval} = $val;
- $conn->{timeout} = Timer->new($val, sub{ &_timedout($conn) });
+ $conn->{timeout} = DXTimer->new($val, sub{ &_timedout($conn) });
}