delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/06/07/14:57:02

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE9DE386F460
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1591556172;
bh=orMopKbSVbVD4kCHXJQ5Tb26G66f+XUqVR/4Leqhdgk=;
h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=W6rd0B6iWIjyseiH8S9+8hkGZe1MmMexmJ5VOLGkRaMRvlyblkEFyQHlk0CEHAYKz
urKPJ8XxLIG8un/FnQXtzWIH7w+TKZraGjTABkb40YzMasW9wmmLBwZK0vWRqGZedL
Wji2JpjRFvIJBNCQiSLBAEuCciRIIjE37IKwSPFc=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4B2593858D34
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: <CAEF1h+WHsGXzSykQ0G3aXG=8jY5VmpYQQiYNP7DjHJTS1Bkpsw AT mail DOT gmail DOT com>
<ba71f855-276d-9d45-5c78-6d0a91dc57dd AT cornell DOT edu>
In-Reply-To: <ba71f855-276d-9d45-5c78-6d0a91dc57dd@cornell.edu>
Date: Sun, 7 Jun 2020 14:56:01 -0400
Message-ID: <CAEF1h+UuQmXz-ntG6YMed+DKFgikJT_aJN5Hu94ZnZ8_LGxMjQ@mail.gmail.com>
Subject: Re: TCP_KEEPINVTL and TCP_KEEPIDLE - Socket Keep Alives not working
To: Ken Brown <kbrown AT cornell DOT edu>, cygwin AT cygwin DOT 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
X-Content-Filtered-By: Mailman/MimeDel 2.1.29
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <http://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Cary Lewis via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Cary Lewis <cary DOT lewis AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

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 <cygwin AT cygwin DOT com>
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
>
--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019