FTP peculiarity

T

thewhoracle

I am having this weird problem with FTP in C# 1.1. I am using an open
source library for FTP connections, and everything works fine all the
time except when i try to connect to one specific server. This one
server will allow me to connect but when I request any data including a
'dir' i get an exception:

<Failed to connect for data transfer: A connection attempt failed
because the connected party did not properly respond after a period of
time, or established connection failed because connected host has
failed to respond>

But the strange thing is, not only does my program work with all other
FTP servers i've tried, but I can connect to the problematic server
using my command line ftp client and ws_ftp without a hitch. Also i
tried several different libraries out there and still, my C#
applications will not successfully data transfer with this one server.
So my question is, is there something unique to C# data sockets or
TCP/IP that would explain this behavior? Does anyone have any other
ideas at facets i should explore in trying to solve this problem?
 
N

Nicholas Paldino [.NET/C# MVP]

At that point, I would either try to use another FTP component, or look
into writing your own. The protocol is not that difficult, and you could
probably implement it quickly.

Writing your own would also allow you to figure out what that particular
server is returning which is out of order (at least, in relation to your FTP
class).

If you want to take a look at the protocol yourself, you can look for
Request For Comments (RFC) 959.

Hope this helps.
 
W

William Stacey [MVP]

As a test, if you have vs2005 beta2, FX 2.0 has FTP client support. If that
works, then your client lib is most likely the issue.
 
T

thewhoracle

tried several client libs, none work with this one server. and i have
vs2003. i may look into implementing my own proto but i feel like
that won't help considering 3 different client libraries didn't do the
trick, and their creators were more knowledgeable than myself
 
W

William Stacey [MVP]

Try the FX 2.0 lib. It is probably worth a shot before going down the RFC
path and rolling your own.
 
W

William Stacey [MVP]

do i need to download that/will it work with vsNet2003?

Unfortunatly no. You need VS2005 Beta2 to try it (which will install FX
2.0). The other idea it to Rev the bad server to another ftp version or
other product. It sounds like maybe the server is not following the RFC
correctly. You could do a network capture to figure that out. That may be
the best way to figure out who/what is to blame. What is the server FTP
software?
 
J

Jacky Kwok

thewhoracle said:
I am having this weird problem with FTP in C# 1.1. I am using an open
source library for FTP connections, and everything works fine all the
time except when i try to connect to one specific server. This one
server will allow me to connect but when I request any data including a
'dir' i get an exception:

<Failed to connect for data transfer: A connection attempt failed
because the connected party did not properly respond after a period of
time, or established connection failed because connected host has
failed to respond>

But the strange thing is, not only does my program work with all other
FTP servers i've tried, but I can connect to the problematic server
using my command line ftp client and ws_ftp without a hitch. Also i
tried several different libraries out there and still, my C#
applications will not successfully data transfer with this one server.
So my question is, is there something unique to C# data sockets or
TCP/IP that would explain this behavior? Does anyone have any other
ideas at facets i should explore in trying to solve this problem?


If the special server can be connected from other client app (command
line ftp client and ws_ftp,etc),
it is possible the server is behind a firewall and just can be connected
in FTP port mode but your library just connect it in port mode.

Check your FTP library, find out can it set the FTP port/passive mode.
Try different mode.

For the difference of port/passive mode, you can refer
http://support.microsoft.com/?kbid=323446
 
T

thewhoracle

i wouldn't know, it's a remote server from which i am procuring
invetory information
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top