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

  • Home
  • SEARCH
  • 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 528k
  • Answers 527k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I'm not sure just how slow the current implementation is.… May 16, 2026 at 10:52 pm
  • Editorial Team
    Editorial Team added an answer Per the first half of your question: you should get… May 16, 2026 at 10:52 pm
  • Editorial Team
    Editorial Team added an answer Like I said in the comment, this has been asked… May 16, 2026 at 10:52 pm

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
.Net framework contains a great class named Convert that allows conversion between simple types,
My application requires the .NET Framework version 3.5. I recently ran into a customer
Has the requirement to deploy the .NET framework with a .NET application caused programmers
I'm developing an ASP.NET WebForm application with .NET Framework 3.5 SP1 and C#. I
I am building an asp.net site in .net framework 4.0, and I am stuck
I have implemented a HttpModule in ASP.NET (framework 2.0). From my logging on the
This is for Entity Framework for .NET 3.5: I have the need to query
Entity Framework 4, POCO objects and ASP.Net MVC2. I have a many to many
I upgraded my development machine to Windows 7 and my project to .NET 3.5.

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.