omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Is it possible to open several FTP connections, at the same time, with different FTP servers?

    Pythonista
    2
    5
    3459
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cvp
      cvp last edited by

      I want to upload some local files, through FTP, to several different FTP Servers.
      To avoid to perform successive "connect/login/upload files/close", is it possible to open several connections to different FTP servers at the same moment, or the common port number (21) does allow that?
      So I could do "connect-1/connect-2/login-1/login-2/upload 1st file-1/upload 1st file-2/......../close-1/close-2"

      1 Reply Last reply Reply Quote 0
      • ccc
        ccc last edited by

        You might try a google search on "Python async ftp". In general, Python supports threads, multiprocessing, and in Python 3 asyncio. Apple's iOS restrictions prevent multiprocessing from working in Pythonista. If you are ok to use Python 3 only then you might look into using stash to bring in https://pypi.python.org/pypi/aioftp which uses asyncio. Otherwise, look at the threading examples in the search above. Each session will need its own port -- I.e. Not everyone on port 21.

        1 Reply Last reply Reply Quote 0
        • cvp
          cvp last edited by

          Thanks for your answer but both FTP servers oblige port 21 😢
          That's not vital, I'll upload all files to one server at a time.

          1 Reply Last reply Reply Quote 0
          • ccc
            ccc last edited by

            You could still get some parallelism by having port 1030 on your Pythonista box talking with port 21 on server_a while on a different thread, port 1031 on your Pythonista box was talking with port 21 on server_b.

            1 Reply Last reply Reply Quote 0
            • cvp
              cvp last edited by

              Thanks for your perseverance in trying to help me...
              But I'll use the easiest solution by uploading all my files to only one FTP server at a time.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors