TCP_KEEPINVTL and TCP_KEEPIDLE - Socket Keep Alives not working

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Jun 30 16:53:58 GMT 2020


On Jun 30 09:46, Cary Lewis via Cygwin wrote:
> Thanks for the reply. The answer to your question is that the 2 hour keep
> alive was not sufficient for a particular use case I encountered.
> 
> I was trying to use curl under cygwin to access a very slow REST endpoint
> that was taking up to 8 minutes to generate download before any data flowed
> back to the client. This caused the server to abort the socket.
> 
> Accessing the endpoint in chrome or firefox revealed that they set a
> keepalive to 45 seconds, which kept the server happy.
> 
> Attempting to set --keepalive-time=45 in cygwin's curl didn't work, and
> wireshark revealed that no keepalives were being sent.
> 
> I will attempt to patch cygwin, I got the build to work. Can you point me
> in the right direction, in terms of where the socket calls get mapped to
> the winsock calls?

Actually, while I'm usually happy to take contributions, you don't have
to dig into that yourself.  I already have a few local patches in the
loop changing some of the affected code.  I have a good idea what's
required to add the keep-alive socket options to that code, so just lay
back and stay tuned for now.

> On a separate note, what are your thoughts on the new windows WSL2 release?
> Do you think this will have long term implications for cygwin?

Same as WSL, I guess ¯\_(ツ)_/¯


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer


More information about the Cygwin mailing list