From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by sourceware.org (Postfix) with ESMTPS id 4B2593858D34 for ; Sun, 7 Jun 2020 18:56:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4B2593858D34 Received: by mail-lj1-x243.google.com with SMTP id e4so17794762ljn.4 for ; Sun, 07 Jun 2020 11:56:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=IptkSRt4sfARJmdMqsklcB5DGJs417f7WQw66kZYaBw=; b=k5XPlIRY7zwHCHdD27Vp2jhbDjh8aqR/DzvImILx+XX43Pf2OTRPkdmTTMf2m8hth4 DLHZxbd3CFWojCMr4/UpxJ0hNs0TQ5xkw41HGLY2Zq2mQzbEhhK5YFBbLWK5xW5+eUVt nKc7WPhNuxopaU1YKZLT5PgluV0fIvEIJzZcWYNuzq6QJeh5+oLx5R0FpkDjwbmgFhQj QyP3dw4oh9OVAZOLq2/A4YPmj6RH0Q9sqhO2ljF8uEE3vcJhBOIUbsY9wObpmxaCXhjs gBsECxHRWrTlD/0BXKWvhx+LCqlrpjSXBQAN7YarT9lQc7KZA6iz/md4ChrVjIWszz+x EwFw== X-Gm-Message-State: AOAM530D2ssTqBLvgnZp4s7UNTI40YeZCcup1pwZ3q3PpSaPV9wJsQj0 I6XwteQ27iL4ug0n5BxpVxP66LsVmusRr7gG2k5nEt4= X-Google-Smtp-Source: ABdhPJycXEtoV/FqHcq+k+8pif93ne/gpSFaYn6LxWVFY7iNYEs984JBb7DgvYapeFEkeio9DJlZ+GjF2nWUKpMJD50= X-Received: by 2002:a2e:3a18:: with SMTP id h24mr9602637lja.268.1591556168969; Sun, 07 Jun 2020 11:56:08 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Cary Lewis Date: Sun, 7 Jun 2020 14:56:01 -0400 Message-ID: Subject: Re: TCP_KEEPINVTL and TCP_KEEPIDLE - Socket Keep Alives not working To: Ken Brown , cygwin@cygwin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2020 18:56:12 -0000 Thanks very much for the reply - I will wait for Corinna's take on this as well - the patch shouldn't be too hard. In fact the source code for curl in the lib/connect.c file has code to enable the winsock options, so hopefully that code could be helpful. I imagine there must be a translation between the POSIX sockets and winsock in the fhandler_socket. I will attempt to download the cygwin source code - I've never built it, so I don't know how hard it will be. I am surprised that no one else has ever needed the low level TCP keep alives to work. On Sun, Jun 7, 2020 at 2:21 PM Ken Brown via Cygwin wrote: > 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 > -- > Problem reports: https://cygwin.com/problems.html > FAQ: https://cygwin.com/faq/ > Documentation: https://cygwin.com/docs.html > Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple >