LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Development of a simple Client FTP: Error 425! (http://www.linuxquestions.org/questions/programming-9/development-of-a-simple-client-ftp-error-425-a-4175436133/)

stefano68 11-07-2012 02:28 PM

Development of a simple Client FTP: Error 425!
 
Hallo to every body,
I'm developing a simple client ftp under C/C++ and using socket functions. I have already developed a simple Class in Windows, just to test easily my small program, taking care to use a common language as close as possible to the linux environment. It worked in Windows! I've ported the code under linux (openSuse 12) and it doesn't work. In both cases the firewall is disabled. I'm using Attive mode in ftp: I create the first socket for the command pourpose, and after having connected to the server I created the listening socket before to ask to the server the NLST command. When I try to listen, the status is idle and after 1 or 2 minutes the socket retrieve error code 425.
What to do? Where is possibile to look for a sample code where this feature is rightly working under linux?
Thank you in advance for your answer
Stefano

firstfire 11-10-2012 05:48 AM

Hi.

Welcome to LQ!
Try to look at the source code of existing ftp clients. For example, tnftp. Namely a dataconn() function in src/ftp.c looks relevant. I'd recommend to download the source code and grep it for word active.

Hope this helps.

stefano68 11-19-2012 01:01 AM

Thank you fistfire for you answer, but I discovered that my code was ok. I am using a linux virtual machine within a windows 7 host, through VirtualBox. This virtualization software suffer for a bug with ftp and ping protocol, that are not forwarded correctly.
I sorted out the problem bypassing it: it works good using a Passive Ftp connection.
Thank you

firstfire 11-19-2012 01:49 AM

Hi.

Glad to hear you solved the problem!


All times are GMT -5. The time now is 11:30 PM.