[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Strange error with ftpapi



Hi, Mario:

The 6-byte values in parentheses do start with an IP address.  But the next two bytes are the PORT number assigned to the transaction.  As an easy example, if port 16384 (x'4000') had been assigned to a transaction with IP address 1.3.5.7, you would see something like this in the text:
   
> 0: 227 Entering Passive Mode (1, 3, 5, 7, 64, 0)

As far as the long wait: when you are waiting for the remote system to reply, (in this case, send a file), the program (API) will stay in RECEIVE mode until end of file is indicated by the remote system.  Either that is not occurring or the occurrence is being blocked in some manner such as a firewall.

You could force a timeout value by specifying that in your FTP_CONN or FTP_OPEN function call.  That should stop the waiting and return a -1 to your receiving procedure when this occurs.

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"Always do right. This will gratify some people and astonish the rest."
        -- Mark Twain 


> I am using ftpapi to send and receive a file to another host. It works
> very well but sometimes it happen that the application wait
> indefinitely. The program does the following steps:
> Connect to the server ftp(ftp_conn),
> set the passive mode(FTP_passiveMode)
> change directory (ftp_chdir)
> send the file(ftp_put)
> wait few second
> change directory (ftp_chdir)
> get the file, i.e. the answer,(ftp_get)
> end the connection (ftp_quit)
> Looking into the log I see this jolog:
> 0: FTPAPI version 2.3 released on 2010-05-27
> 0: 220 en1 FTP server (Version 4.1 Mon Jul 26 19:58:48 CDT 1999) ready.
> 0: > USER nike
> 0: 331 Password required for nike.
> 0: > PASS **********
> 0: 230 User nike logged in.
> 0: > CWD in
> 0: 250 CWD command successful.
> 0: > TYPE I
> 0: 200 Type set to I.
> 0: > PASV
> 0: 227 Entering Passive Mode (80,19,175,115,124,210)        <-----
> this is the correct IP addr of the ftp server
> 0: > STOR 3056010.ORD
> 0: 150 Opening data connection for 3056010.ORD.
> 0: 226 Transfer complete.
> 0: > CDUP
> 0: 250 CWD command successful.
> 0: > CWD out
> 0: 250 CWD command successful.
> 0: > TYPE I
> 0: 200 Type set to I.
> 0: > PASV
> 0: 227 Entering Passive Mode (192,168,100,3,187,154)      <----  ip
> addr???
> 0: > TYPE I
> 0: 200 Type set to I.
> 0: > PASV
> 0: 227 Entering Passive Mode (192,168,100,3,187,220)   <---- IP addr??
> I don’t understand these strange ip addr.
> Can someone help me to understand why the pgm wait and why there are
> these Ip addr?
> Thanks in advance
> Mario

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------