+ delete $circuit{$conn->{agwcall}};
+ if ($conn->{incoming}) {
+ _sendf('d', $conn->{agwcall}, $main::mycall, $conn->{agwport}, $conn->{agwpid});
+ } else {
+ _sendf('d', $main::mycall, $conn->{agwcall}, $conn->{agwport}, $conn->{agwpid});
+ }
+ $conn->SUPER::disconnect;
+}
+
+sub enqueue
+{
+ my ($conn, $msg) = @_;
+ if ($msg =~ /^D/) {
+ $msg =~ s/^[-\w]+\|//;
+# _sendf('Y', $main::mycall, $conn->{call}, $conn->{agwport}, $conn->{agwpid});
+ _sendf('D', $main::mycall, $conn->{agwcall}, $conn->{agwport}, $conn->{agwpid}, $msg . $conn->{lineend});
+ my $len = length($msg) + 1;
+ dbg('agw', "AGW Data Out port: $conn->{agwport} pid: $conn->{agwpid} '$main::mycall'->'$conn->{agwcall}' length: $len \"$msg\"");
+ }
+}
+
+sub process
+{
+ return unless $sock;
+ if ($ypolltime && $main::systime - $lastytime >= $ypolltime) {
+ for (my $i = 0; $i < $noports; $i++) {
+ _sendf('y', undef, undef, $i );
+ }
+ $lastytime = $main::systime;
+ }
+ if ($hpolltime && $main::systime - $lasthtime >= $hpolltime) {
+ for (my $i = 0; $i < $noports; $i++) {
+ _sendf('H', undef, undef, $i );
+ }
+ $lasthtime = $main::systime;
+ }