2 # module to manage connection lists & data
12 # create a new connection object [$obj = Connect->new($call, $msg_conn_obj, $user_obj)]
15 my ($pkg, $call, $conn, $user) = @_;
18 die "trying to create a duplicate Connect for call $call\n" if $connects{$call};
19 $self->{call} = $call;
20 $self->{conn} = $conn;
21 $self->{user} = $user;
25 return $connects{$call} = $self;
28 # obtain a connection object by callsign [$obj = Connect->get($call)]
31 my ($pkg, $call) = @_;
32 return $connect{$call};
35 # obtain all the connection objects
39 return values(%connects);
42 # obtain a connection object by searching for its connection reference
45 my ($pkg, $conn) = @_;
48 foreach $self (values(%connects)) {
49 return $self if ($self->{conn} == $conn);
54 # get rid of a connection object [$obj->del()]
58 delete $connects{$self->{call}};