Hi All,

 

I have an issue when something goes wrong with the client that's trying
to connect.

9 out of 10 times this works fine, but there are odd situations where
$clientip doesn't get filled in, which leaves me with a connection I
can't do anything with... 

I tried to use close($client) to just terminate these odd connections
when $clientip is empty but that doesn't work.. 

The program keeps running but these 'zombie' connections will eventually
fill up my system. 

 

Just a small snip of the program... 

 

#!/usr/bin/perl -w

 

use strict; 

use IO::Socket qw(:DEFAULT :crlf);

 

my $server = IO::Socket::INET->new(Proto=>"tcp", LocalPort=>$port,
Listen=>$maxconn, Reuse=>1, Timeout=>300)

    or die "Can't setup server\n";

 

while ( $client = $server->accept()) {

    $clientip = $client->peerhost();

    $clienthost = gethostbyaddr($client->peeraddr,AF_INET);

   # Some other stuff

}

 

Thanks for any tips! 

 

- 

Marco van Kammen
Springer Science+Business Media
System Manager & Postmaster 

- 

van Godewijckstraat 30 | 3311 GX
Office Number: 05E21 
Dordrecht | The Netherlands 

-  

tel 

 +31(78)6576446

fax 

 +31(78)6576302

- 

www.springeronline.com <http://www.springeronline.com>  
www.springer.com <http://www.springer.com/> 

- 

 

 

Reply via email to