curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: A single request in loop on macOS

From: Jicea via curl-library <>
Date: Wed, 20 Mar 2024 16:01:25 +0000

Thanks Daniel,

That may be a good explanation why error are happening around at the same request. I struggled to see what can explain the errors to be so “consistent”!

I will dig further into the port exhaustion explanation,


Orange Restricted

From: Daniel Stenberg <>
Date: Tuesday, 19 March 2024 at 23:42
To: Jicea via curl-library <>
Cc: AMIEL Jean-Christophe DTSI/SI <>
Subject: Re: A single request in loop on macOS
On Tue, 19 Mar 2024, Jicea via curl-library wrote:

> I launch the main 4 or 5 times in a row, one process at a time. Each time,
> I've error the 4rth or 5th times I launch `main`:

In your email snippet it stopped after about 5000*3+1370 (16370) rounds.

After 16,000 or so connections (within one or just a few seconds) it fails to
connect. To me, that indicates that a resource of some sort has run out, which
possibly makes curl fail to create the new socket.

Could it be ephemeral port exhaustion? macOS is said to have 16384 such ports
(49152 to 65535), and it can't reuse them immediately.

Linux seems to use a much wider range by default.

  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.

Received on 2024-03-20