Re: [BUGS] BUG #14720: getsockopt(TCP_KEEPALIVE) failed: Option notsupported by protocol - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: [BUGS] BUG #14720: getsockopt(TCP_KEEPALIVE) failed: Option notsupported by protocol
Date
Msg-id CAB7nPqTjucafvkZGusT2aJp2gHivgwxoEOBxQoSUPhKrEU41ew@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] BUG #14720: getsockopt(TCP_KEEPALIVE) failed: Option not supported by protocol  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [BUGS] BUG #14720: getsockopt(TCP_KEEPALIVE) failed: Option not supported by protocol  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Wed, Jun 28, 2017 at 7:26 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Concretely, something like the attached.  I have no way to test this
> locally, so I'm thinking of just pushing it and seeing what the buildfarm
> says.

! #if defined(TCP_KEEPIDLE)
!     /* TCP_KEEPIDLE is the name of this option on Linux and *BSD */     if (setsockopt(port->sock, IPPROTO_TCP,
TCP_KEEPIDLE,                   (char *) &idle, sizeof(idle)) < 0)     {         elog(LOG, "setsockopt(TCP_KEEPIDLE)
failed:%m");         return STATUS_ERROR;     }
 
! #elif defined(TCP_KEEPALIVE_THRESHOLD)
What about defining a PG_TCP_KEEPALIVE instead?

Side note: Windows has something with a different set of options:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms740476(v=vs.85).aspx
-- 
Michael


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14720: getsockopt(TCP_KEEPALIVE) failed: Option not supported by protocol
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14720: getsockopt(TCP_KEEPALIVE) failed: Option not supported by protocol