rlopzc
Learn how to leverage Erlang + Elixir’s GenServer to build a robust FTP Client.
https://rlopzc.com/posts/elixir-ftp-client-genserver-part-1/
Trending in Blog Posts
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New
At the heart of every Phoenix application is the often “invisible” HTTP server layer.
For over a decade Cowboy has served the community ...
New
I wrote up a blog post talking about the first skill I made, one that does a detailed Elixir dependency update.
More than Dependabot, it...
New
I’ve published Part 4 of my Elixir distributed systems learning series.
This part explores process linking using low-level primitives di...
New
Hey everyone! :waving_hand:
I’ve published Part 7 of the Building Distributed Systems in Elixir series, where we build core distributed ...
New
So, instead of wasting my afternoon arguing with anonymous handles on X, I turned to my trusty, soulless assistant and said: “Listen, ple...
New
New article: Elixir Project Structure — From mix new to a Growing Codebase
I’ve published a new article in my Elixir learning series on d...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
mudasobwa
Well put! The only thing that bugs me is this code would suffer crashes operating against slow ftp servers. The code below would blow up if there is no response for
:ftp.ls/0is 5 seconds.I would probably put a greater timeout or even
:infinitythere.D4no0
Damn, this is like a blast from the past. We were using
ftpfor one of our projects back in the day, nasty stuff when it stops working silently.The approach we took back then was to check for files every 1 minute. What we did differently was that we would establish a new connection every-time and close when done, this builds a layer of fault-tolerance because we were interacting with different ftp servers, different versions and OS, and sometimes they would start behaving weirdly for no reason.
rlopzc
Thanks!!
Uff this is a hard one because it can block the calling process infinity.
rlopzc
Were you able to use
mode: :activeduring that time? I’ve done some experiments but can’t get the active mode to work (receiving data as messages).D4no0
No, we were strictly using passive mode, it would be extremely annoying to set the infrastructure to allow incoming connections.
We did have an issue where data transfer would not work. There was a misconfigured
ftpserver behind a proxy that would send its local IP for data connections, but send the correct public one for commands, so it would work until you wanted to make file transfers. What I ended up doing was to extract theftplibrary from OTP, mass rename it and change the library to always fetch the IP from the initial command connection for data connections.I don’t remember exactly how I found out the exact issue, but I think it was by running
ftpin verbose mode, it literally shows all the steps it takes if I remember correctly.adamu
I think it would be useful to include automated tests, as especially for clients and GenServers, this is likely to considerably change the design.