TCP_KEEPINVTL and TCP_KEEPIDLE - Socket Keep Alives not working

Ken Brown kbrown@cornell.edu
Sun Jun 7 18:19:40 GMT 2020


On 6/7/2020 9:20 AM, Cary Lewis via Cygwin wrote:
> These constants are usually defined in  netinet/tcp.h but are not defined
> anywhere in cygwin.
 >
> As a result there does not seem to be a way to enable the socket level keep
> alives in cygwin.
> 
> One result of this is curl's --keepalive-time option does not work, but it
> would affect any attempt to enable socket keep alives.
> 
> Windows' sockets do support keep alives, and indeed the win32 version of
> curl works correctly.
> 
> Can someone explain why the TCP keep alive constants are not defined

I'm not an expert on sockets, but I'll just make a couple of comments until 
Corinna has a chance to give a definitive reply.

Cygwin's netinet/tcp.h was derived from the FreeBSD version of the file dated 
2000/01/09.  It has hardly been touched since it was imported into Cygwin in 
2002.  FreeBSD didn't add keepalive support until 2012.

> Is it possible to add this functionality?

If you're asking someone else to do it, the question is whether one of the 
Cygwin developers has the time and expertise to do it.  If you're volunteering 
to do it, patches are always welcome.

> Where in the cygwin source code does the actual posix socket to winsock
> translation take place?

Cygwin's socket support is in the fhandler_socket* files.

Ken


More information about the Cygwin mailing list