For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > September 2005 > FTP server code in passive mode









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author FTP server code in passive mode
ssantamariagarcia@hotmail.com

2005-09-19, 6:58 pm



I have programmed a FTP server in active mode but it falls on the
client side. The error message is "Connection refused" that appears
when server is trying to connect back to the client's specified data
port from its local data port. I have told that I need to change the
code in order to get a server program that is able to manage connection
in a passive mode.

I wonder if any of you know the necessary changes in the code to get a
pasive mode FTP server,or maybe, where to find programming information
in C language about it.




Thanking you in advance,

Sonia Santamar=EDa.

(Sorry about my English.....)

Ulrich Hobelmann

2005-09-19, 6:58 pm

ssantamariagarcia@hotmail.com wrote:
> I wonder if any of you know the necessary changes in the code to get a
> pasive mode FTP server,or maybe, where to find programming information
> in C language about it.


You need to implement the PASV and EPSV commands. Basically you need to
open a listening socket on your server (on whatever port you like) and
send the client a response indicating your ip and port (for PASV) or
just the port number (for EPSV). The client should then connect to your
socket and issue a command (data transfer, LIST, NLST) and you
send/receive data.

Take a look at how existing clients and servers do it.

--
My mouth says the words, my brain is thinking monstertrucks.
Joey (Friends)
ssantamariagarcia@hotmail.com

2005-09-20, 3:57 am



>
> Take a look at how existing clients and servers do it.
>
> --
> My mouth says the words, my brain is thinking monstertrucks.
> Joey (Friends)



Thanks a lot Ulrich. I have already trying to implement the PASV
command (little mess...). I will tell you how I am doing .

Thanks again,
Sonia

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com