We're having problems connecting to a particular server with the FTP.NET Winform Sample Client (WinFormClient.exe). The FTP server we're trying to connect to is running Windows Server 2008 R2 (x64) with IIS7.5.

Here's the log file output:

18:57:32.798 Info Response: 220 Microsoft FTP Service
18:57:32.811 Info Command: USER JUser
18:57:32.850 Info Response: 331 Password required for JUser.
18:57:32.855 Info Command: PASS *************
18:57:32.884 Info Response: 230 User logged in.
18:57:32.890 Info Command: FEAT
18:57:32.911 Info Response: 211-Extended features supported:
18:57:33.127 Info Response:  LANG EN*
18:57:33.131 Info Response:  UTF8
18:57:33.136 Info Response:  AUTH TLS;TLS-C;SSL;TLS-P;
18:57:33.142 Info Response:  PBSZ
18:57:33.147 Info Response:  PROT C;P;
18:57:33.152 Info Response:  CCC
18:57:33.159 Info Response:  HOST
18:57:33.164 Info Response:  SIZE
18:57:33.167 Info Response:  MDTM
18:57:33.174 Info Response:  REST STREAM
18:57:33.178 Info Response: 211 END
18:57:33.183 Info Command: SITE
18:57:33.204 Info Response: 214-The following SITE commands are recognized (* ==>'s unimplemented).
18:57:57.376 Error Info: Rebex.Net.FtpException: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at Rebex.Net.ProxySocket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at wWGvS.AgXIfM.BMJzdYZ(Byte[] , Int32 )
   at wWGvS.AgXIfM.BbLKfs(String& )
   at wWGvS.AgXIfM.KsZclZ()
   at Rebex.Net.Ftp.cgrDQE(Int32 )
   --- End of inner exception stack trace ---
   at Rebex.Net.Ftp.cgrDQE(Int32 )
   at Rebex.Net.Ftp.vEGVl()
   at Rebex.Net.Ftp.Login(String userName, String password)

We're able to connect fine using other FTP software (such as FileZilla), so it appears to be a problem with the Rebex library...?

Thanks for any help.

asked 04 Jun '10, 18:27

Jackson%20Pollack's gravatar image

Jackson Pollack
284
accept rate: 0%

edited 10 Aug '10, 13:17

Rebex%20KB's gravatar image

Rebex KB ♦♦
256312

This looks like Rebex FTP got stuck while waiting for SITE command response. This has not been reported before - we are running our automated tests against MS FTP 7.5.

Please locate the "_ftp = new Ftp();" line in the WinFormClient sample and add the following line below it: "_ftp.Options |= FtpOptions.DoNotDetectFeatures;" - does this make any difference? (Please post the log if it doesn't.)

(04 Jun '10, 19:00) Lukas Pokorny ♦♦

(In VB.NET, locate "_ftp = New Ftp" and add "_ftp.Options = _ftp.Options Or FtpOptions.DoNotDetectFeatures")

(04 Jun '10, 19:00) Lukas Pokorny ♦♦

It worked! Connects perfectly now! Thanks!

(05 Jun '10, 11:11) Jackson Pollack

(You should have posted it as an answer, so I could mark this question solved :)

(05 Jun '10, 11:12) Jackson Pollack

Thanks! I did not actually expect that this alone would help - I thought several more iterations would be needed first. But I will repost this as an answer now :-)

(07 Jun '10, 12:23) Lukas Pokorny ♦♦

This looks like Rebex FTP got stuck while waiting for the SITE command response. Unlike FileZilla, we are using the SITE command to detect MS IIS FTP 7 and 7.5, but it looks like this is not working.

To work around this issue, try disabling FTP server feature detection. Locate the following line in the WinFormClient sample:

_ftp = new Ftp();

And add the following line below it:

_ftp.Options |= FtpOptions.DoNotDetectFeatures;

If this doesn't help, please let us know and post an updated log.

More information: The issue itself is unlikely to be caused by MS IIS FTP 7.5 or Rebex FTP alone - we routinely run our automated tests against this FTP server and never noticed such problems. A possible explanation is a FTP-aware firewall along the way that doesn't handle IIS FTP's SITE command response properly.

link

answered 07 Jun '10, 12:30

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.2k18
accept rate: 32%

Thanks again! -JP

(07 Jun '10, 17:38) Jackson Pollack
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×136
×18
×7
×1
×1

Asked: 04 Jun '10, 18:27

Seen: 855 times

Last updated: 10 Aug '10, 13:17