ftp_connect() failed

ftp_connect() failed

am 08.12.2006 17:00:49 von Alek Silverstone

set_time_limit(0);
$i=1;

while (TRUE)
{
$date=date('H:i:s');
$ftp=ftp_connect('127.0.0.1',21,10);
if ($ftp) $login=ftp_login($ftp,'anonymous',$i);
if ($ftp && $login)
{
if (($i % 100) === 0) echo "[$date] $i - online.\n";
} else {
echo "[$date] $i - offline.\n";
break;
}
if ($ftp!==FALSE) ftp_close($ftp);
$i++;
}
?>

This script failed after 100-10000 loops.
Tested on various servers and OSes.

What's wrong?

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: ftp_connect() failed

am 14.12.2006 00:13:22 von Mike Matz

Could it be the FTP server throttling repeated connects from the same
IP? Have you tried on different FTP server software?=20

-----Original Message-----
From: Alek Silverstone [mailto:alek.silverstone@gmail.com]=20
Sent: Friday, December 08, 2006 8:01 AM
To: php-windows@lists.php.net
Subject: [PHP-WIN] ftp_connect() failed

set_time_limit(0);
$i=3D1;

while (TRUE)
{
$date=3Ddate('H:i:s');
$ftp=3Dftp_connect('127.0.0.1',21,10);
if ($ftp) $login=3Dftp_login($ftp,'anonymous',$i);
if ($ftp && $login)
{
if (($i % 100) ===3D 0) echo "[$date] $i - online.\n";
} else {
echo "[$date] $i - offline.\n";
break;
}
if ($ftp!==FALSE) ftp_close($ftp);
$i++;
}
?>

This script failed after 100-10000 loops.
Tested on various servers and OSes.

What's wrong?

--
PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php