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: Hint: curl timeout simulation

From: Daniel F via curl-library <>
Date: Thu, 02 Sep 2021 15:21:17 +0200

W dniu 2021-09-02 09:58, Daniel Stenberg via curl-library napisaƂ(a):
> On Wed, 1 Sep 2021, David Caul via curl-library wrote:
>> 1. can we simulate the curl timeout in code.
> Maybe just make a stub function that instead of calling libcurl

If you are on Linux, you can use this function to shut down receiving
packets on given socket fd. For more details check "man 3 shutdown".
This is probably the easiest way to simulate network timeouts:

shutdown(fd, SHUT_RD);

Received on 2021-09-02