Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 567023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:02:21+00:00 2026-05-13T13:02:21+00:00

Back when .NET Framework 1.0 was launched, there were no good FTP client implementations

  • 0

Back when .NET Framework 1.0 was launched, there were no good FTP client implementations available for .NET so I wrote my own implementation using System.Net.Socket. Recently I had to make some changes to it, and while debugging I noticed garbled output from the IIS 5.1 FTP server I’m testing against (WinXP SP 2) when closing the connection.

The communication goes like this:

Send: QUIT<CRLF>
Receive: 221<CRLF><NUL>?<ETX><NUL>
(socket closed)

The FTP command channel handler is line-oriented using CRLF as terminator, and upon receiving the four bytes after the first CRLF it waits for a second CRLF causing a timeout error. The entire sequence is returned by a single socket read operation, and I’ve verified that the byte count returned from the socket is correct.

This sequence of bytes has been consistent against this server and I was wondering if this is expected/ can be prevented, or if I should simply “quick fix” it adding it to my list of “MS FTP Server quirks”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:02:21+00:00Added an answer on May 13, 2026 at 1:02 pm

    While not ideal, it looks like the FTP Server is returning a correct response, just followed by unexpected stuff. If I were designing the class, I’d have it keep a buffer of unreported text (which you probably have already, in case you read less than a full line in one read), and when the function is called to return a line of text, have it strip out and return the stuff before the CRLF, and leave the rest for the next function – only having it wait for more when there isn’t a full line to return.

    That should solve the above situation. Your function has enough to return “221”, which the caller will interpret as successful, and the caller won’t ask for more, which will prevent the final wait.

    Alternatively, or additionally: If the function could detect the close of socket (since your post makes it look like this is coming from the remote site after it sends the response), it could prevent the wait in that case as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 545k
  • Answers 545k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • added an answer Well, start off by thinking of which bits of data… May 17, 2026 at 9:17 am
  • added an answer For this task it is a good idea to use… May 17, 2026 at 9:15 am
  • added an answer This is exactly how the Skyhook database (built into many… May 17, 2026 at 9:15 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Using the .Net Framework 1.1, what options are available for monitoring threads from other
Can I use two different back ends for an .net Entity Framework project? I
First some background: VB.NET 2005 Application that accesses a MS-SQL back-end, using multiple Web
I'm getting back into .NET after numerous years in PHP/MySQL back in 2002 on
I'm getting back into .NET development after a couple years and it seems that
Back in 2000 (when .NET was unleashed upon us IIRC) it was an innovative
I am getting back into a bit more .NET after a few-years of not
I have developed a VB.NET WCF service that recives and sends back data. When
I have a few ASP.Net database front-end websites where MS Access is the back-end.
I'm working on creating a call back function for an ASP.NET cache item removal

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.