|
Posted by Markus on 05/22/07 10:26
ED schrieb:
> "Markus" <derernst@NO#SP#AMgmx.ch> wrote in message
> news:46517c0c$1_2@news.cybercity.ch...
>> Hi
>>
>> I encountered that FTP connections seem to remain open on the FTP server,
>> though my FTP class has a shutdown function that ftp_quit()s the
>> connection.
>>
>> I did not find any info in the manual regarding the differences of
>> ftp_close() and ftp_quit(). Do I have to use ftp_close()? Or even first
>> close, then quit? Is it possible that ftp_quit() does not close the
>> connection on the FTP server? Or do I have to look for something else?
>>
>> Thanks for some hints!
>> Markus
>
>
> hi Markus,
>
> Just a thought, but maybe try sending an FTP QUIT command to the server
> before closing the conn - it may give the server the hint to close its
> connection(s):
>
> ftp_raw($ftpconn, 'QUIT');
> ftp_close($ftpconn);
Thank you, good point! As ftp_raw() is PHP5 only and the application is
supposed to run from PHP 4.3 upwards, I added reduction of the timeout
period, so the number of possibly open connections on the server should
be reduced to a reasonable amount:
if (function_exists('ftp_raw')) {
ftp_raw($ftpconn, 'QUIT');
}
else {
ftp_set_option($ftpconn, FTP_TIMEOUT_SEC, 1);
}
ftp_close($ftpconn);
[Back to original message]
|