shutdown $socket, 2;
####
while ( my ($new_sock, $clientAddr) = $sock->accept() )
{
my ( $clientPort, $clientIp ) = sockaddr_in( $clientAddr );
# put the connection on the queue for a reader thread
my $fno = fileno($new_sock);
$sockets{ $fno } = $new_sock;
$Q->enqueue( "$fno\0$clientIp" );
while ( $Qclean->pending )
{
my $fileno = $Qclean->dequeue();
$log->warning("Attempting to close handle associated with fileno: $fileno");
close $sockets{ $fileno };
delete $sockets{ $fileno };
}
}
####
SIG{PIPE}='IGNORE';
####
shutdown $socket, 2;
close $socket;