Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keeping "pasv"

Status
Not open for further replies.

amethystct

Programmer
Jan 26, 2004
21
FR
Hi,

I have a program that ftp's a file from a server that is outside our firewall. I'm told I have to send the "pasv" command in order to let the data connection bring the file back. I can see in the debugging that it's setting the connection as passive but it sets it back to active when I get the file. I'm getting a new socket connection which is passing zero. This is wrong. I want to pass the port that would have been passed to me by the server (?). How do I set the socketconnection to that port? If I get the response from the passive command I get:

227 Entering Passive Mode (198,62,245,39,170,44)

The port I should use is 17044 ? Will it always be the last 5 digits? Isn't there a way to just get the port w/out having to strip out and rebuild it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top