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 6537057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:34:16+00:00 2026-05-25T10:34:16+00:00

Given this simple 2-step pseudocode: 1. request for a file listing 2. download each

  • 0

Given this simple 2-step pseudocode:
1. request for a file listing
2. download each file

Where each step requires opening a new connection. For step 2, a new connection is also opened per file that needs to be downloaded. The reason why I think it was coded this way is so that any FTP exception encountered (for example 421, connection closed), the downloading of the other files will push through (unless of course step 1 encounters the error, thus no subsequent step 2 will happen).

I’m new to FTP, so this is something that’s been bugging me quite a bit.

  • 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-25T10:34:17+00:00Added an answer on May 25, 2026 at 10:34 am

    Yes, it’s perfectly normal. FTP is a two connection protocol. A command stream (get, put, dir, cd, etc…) and a data stream (the actual files being sent back and forth). The command stream is kept open for the duration of your connection (and is considered “the connection”). The data stream exists only while sending/retrieving data and will be opened/closed multiple times in a typical FTP session.

    The source of the data connection depends on if you’re using active of passive ftp. For active connections, the ftp server will initiate the data connection back to the client. This is done via the client saying “do a ‘dir’ command, and send its results back to IP x.x.x.x, port yyy”. Passive works in the opposite fashion. The client initiates all connections to the server, and doing dir is basically. “Give me a directory listing” and getting back a “Ok, directory data is available at IP x.x.x.x, port YYY – come and get it”.

    On the protocol level, the client will send PORT x.x.x.x.y.z to notify server to open an active mode data channel connection back to client at x.x.x.x on port (y * 256)+z. The client sends PASV to request passive mode; in this case the server’s response contains x.x.x.x.y.z telling client to open connection at ip and port

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

Sidebar

Related Questions

This is probably pretty simple. I want to select all elements of a given
This should be a simple one, but I'm a beginner with C#. Given a
This is a purely theoretical question. Given three simple classes: class Base { }
Given this sample code: #include <iostream> #include <stdexcept> class my_exception_t : std::exception { public:
This very simple code gives me tons of errors: #include <iostream> #include <string> int
This may be simple one, but 5 mins of Googling didn't give me the
Can someone give me a simple example involving threads in this manner, please. Problem
Given this HTML: <ul id=topnav> <li id=topnav_galleries><a href=#>Galleries</a></li> <li id=topnav_information><a href=#>Information</a></li> </ul> And this
Given this XML, what XPath returns all elements whose prop attribute contains Foo (the
Given this class class Foo { // Want to find _bar with reflection [SomeAttribute]

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.