PHP Classes

Class possibly hangs sometimes

Recommend this page to a friend!

      Advanced FTP client class  >  All threads  >  Class possibly hangs sometimes  >  (Un) Subscribe thread alerts  
Subject:Class possibly hangs sometimes
Summary:Class hangs sometimes while connecting ftp server.
Messages:5
Author:Nagender
Date:2008-09-16 16:42:23
Update:2008-09-19 10:15:17
 

  1. Class possibly hangs sometimes   Reply   Report abuse  
Picture of Nagender Nagender - 2008-09-16 16:42:23
Nice Work indeed, i am trying to use that for making FTP based Online File Manager. It usually works 7 out of 10 times but sometimes it just hangs in there after making a connection. After turning verbose & localecho on, this was the output on most occasions
*********************************************
Staring FTP client class

UMASK 022

Transfer type: auto ASCII

Timeout 15

Passive mode off

Host "localhost(127.0.0.1):21"

Local OS : UNIX

Creating socket

Connecting to "127.0.0.1:21"

Connected to remote host "localhost:21". Waiting for greeting.

GET < 220 ProFTPD 1.2.10 Server (Debian) [127.0.0.1] PUT > SYST GET < 215 UNIX Type: L8

Remote OS: UNIX

PUT > FEAT GET < 211-Features: 211-MDTM 211-REST STREAM 211-SIZE 211 End

Supported features:
**********************************
and it just hangs after that, this also causes apache cpu usage to touch quite high making it seem like a blocking operation. So, unless i manually cancel the process, it just stays there. I'am sure it's something simple here, just trying to figure out what :)

  2. Re: Class possibly hangs sometimes   Reply   Report abuse  
Picture of Alexey Dotsenko Alexey Dotsenko - 2008-09-17 07:27:03 - In reply to message 1 from Nagender
That was due to not standart server response. i think that i fix it.

  3. Re: Class possibly hangs sometimes   Reply   Report abuse  
Picture of Nagender Nagender - 2008-09-19 03:16:48 - In reply to message 2 from Alexey Dotsenko
you already fixed it? or you will fix it?
Any clue as to the code snippet which might be causing this behavior!
thanks for all your efforts :)

  4. Re: Class possibly hangs sometimes   Reply   Report abuse  
Picture of Nagender Nagender - 2008-09-19 05:04:35 - In reply to message 2 from Alexey Dotsenko
On further tests, found that if i restrict php execution time and socket timeouts etc, i get this socket failure messages with ftptest.php file
********************************************************
PUT > TYPE A GET < 200 TYPE is now ASCII Creating data socket PUT > PORT 127,0,0,1,193,68 GET < 200 PORT command successful PUT > NLST -la nlist: Read failed (Resource temporarily unavailable) GET < 150 Connecting to port 49476 226-Options: -a 226 0 matches total
Notice: Undefined offset: 1 in /home/public_html/test/ftp_class_sockets.php on line 67
Disconnected data from remote host Creating data socket PUT > PORT 127,0,0,1,222,71 GET < 200 PORT command successful PUT > LIST -lA . rawlist: Read failed (Resource temporarily unavailable) GET < 150 Connecting to port 56903 226-Options: -a -l 226 7 matches total
Notice: Undefined offset: 1 in /home/public_html/test/ftp_class_sockets.php on line 67
Disconnected data from remote host LIST FAILS!PUT > QUIT GET < 221-Goodbye. You uploaded 0 and downloaded 0 kbytes. 221 Logout. Session finished Socket closed

  5. Re: Class possibly hangs sometimes   Reply   Report abuse  
Picture of Alexey Dotsenko Alexey Dotsenko - 2008-09-19 10:15:17 - In reply to message 4 from Nagender
It seems that i have to rewrite server response processor