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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP Hung out to dry.

Status
Not open for further replies.

DarwinIT

Programmer
Apr 25, 2008
142
US
I just wrote an application which employes FTP to read and copy files. It worked fine on our test FTP server - which is on our network. We got a new server just for this task and my application which worked flawlessly now hangs up when making a call to read the directory. The statement that causes the hang is

client = listner.AcceptTcpClient();
listner is a TcpListener and client is a TcpClient

I suspect this has something to do with the firewall or with the setup of FTP (interactive FTP works just fine - it just doesn't work from the c# code.) Anyone have a clue here???
 
One new piece of information. Before the call is made to AcceptTcpClient - a 425 error is encountered. The code I have only looks at the first response which is an acceptable 150. So it does not have a data connection at the time it is issuing this command. So the real issue seems to be the 425 error.
 
I have resolved the problem by switching from Active mode to passive mode. Ironically some of the people in threads that I found fixed the problem by doing the reverse. Go figure!! Anyway it works now. Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top