X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXConnect.pm;h=4a6bbf109c899234ebe264c2437530445dbbfa10;hb=2b58ccdf81685a1167a43c38705a0d84b9d8d661;hp=0d48676f3e6eb576b5b47e3fd9464a2c090e41ee;hpb=2e16209416d1d189707935868a708b525c93097b;p=spider.git diff --git a/perl/DXConnect.pm b/perl/DXConnect.pm index 0d48676f..4a6bbf10 100644 --- a/perl/DXConnect.pm +++ b/perl/DXConnect.pm @@ -1,62 +1,37 @@ # -# module to manage connection lists & data +# module to manage outgoing connections and things +# +# Copyright (c) 1998 - Dirk Koopman G1TLH +# +# $Id$ # package DXConnect; -require Exporter; -@ISA = qw(Exporter); +@ISA = qw(DXChannel); -%connects = undef; +use DXUtil; +use DXM; +use DXDebug; -# create a new connection object [$obj = Connect->new($call, $msg_conn_obj, $user_obj)] -sub new -{ - my ($pkg, $call, $conn, $user) = @_; - my $self = {}; - - die "trying to create a duplicate Connect for call $call\n" if $connects{$call}; - $self->{call} = $call; - $self->{conn} = $conn; - $self->{user} = $user; - $self->{t} = time; - $self->{state} = 0; - bless $self, $pkg; - return $connects{$call} = $self; -} +use strict; -# obtain a connection object by callsign [$obj = Connect->get($call)] -sub get -{ - my ($pkg, $call) = @_; - return $connect{$call}; -} +use vars qw($VERSION $BRANCH); +$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); +$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ ) || 0; +$main::build += $VERSION; +$main::branch += $BRANCH; -# obtain all the connection objects -sub get_all +sub init { - my ($pkg) = @_; - return values(%connects); -} -# obtain a connection object by searching for its connection reference -sub get_by_cnum -{ - my ($pkg, $conn) = @_; - my $self; - - foreach $self (values(%connects)) { - return $self if ($self->{conn} == $conn); - } - return undef; } -# get rid of a connection object [$obj->del()] -sub del +sub process { - my $self = shift; - delete $connects{$self->{call}}; + } 1; -__END__; +__END__ +