# clear read data from the mux string ref
$$str_ref = '';
- my $self;
- my $conn_id = fileno($mux_fh);
+ my $conn_id = ''.$mux_fh;
# check for kids that went away
REAPER();
-
+ my $self;
if (!$active_connections{$conn_id}) { # Brand new connection, log them in
$self = $mself->{net_server};
$active_connections{$conn_id}->{ils} = ref($self->{ils});
delete $$self{ils};
+ my $c = scalar(keys %active_connections);
+ syslog("LOG_DEBUG", "multi: new active connection; $c total");
+
return;
}
} else { # in parent
$kid_count++;
$kid_hash{$pid} = 1;
+ syslog("LOG_DEBUG", "multi: $conn_id forked child $pid; $kid_count total");
}
+}
+# client disconnected, remove the active connection
+sub mux_close {
+ my ($self, $mux, $fh) = @_;
+ delete $active_connections{''.$fh};
+ syslog("LOG_DEBUG", "multi: cleaning up child: $fh");
}
+
#
# Transports
#