Skip site navigation (1) Skip section navigation (2)

Re: pgsql: Add support for TCP keepalives on Windows, both for backend and

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers <pgsql-committers(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgsql: Add support for TCP keepalives on Windows, both for backend and
Date: 2010-07-08 15:42:57
Message-ID: AANLkTikDb-FzpaDGYIyWhIhxRG-BWWaevdVMDidjZH25@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
On Thu, Jul 8, 2010 at 17:39, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> Seems pretty simple - mingw doesn't have support for this. We have two
>> ways to deal with that I think:
>> 1) Disable it on mingw.
>> 2) Include it in our custom headers.
>
>> For #2, what we need to include is the define of SIO_KEEPALIVE_VALS as
>> well as the definition of struct tcp_keepalive.
>
>> We've done #2 before at least once, which worked well until mingw
>> suddenly caught up and added it a while later. It's not like this is a
>> new definition in windows, but we need to be ready for them to
>> eventually do that.
>
> Yeah.  I'm satisfied with doing #1 and waiting for them to fix it.
>
>> I guess there is:
>> 3) write an autoconf test and provide them only when mingw doesn't have it.
>> if we're going with #3, I'll respectfully have to ask somebod yelse to
>> write the autoconf test, that's beyond me I think :-)
>
> An easy approximation would be to make the code #ifdef SIO_KEEPALIVE_VALS.
> That would fail if the mingw guys decide to provide the #define without
> adding the struct at the same time, but that seems moderately unlikely.

Seems reasonable. I'll go do something along that line and verify that
it actually works :-)

That laves the questions of docs - right now the docs just say it
works on windows. I guess we need to add some kind of disclaimer
around that, but the fact is that for 99+% of our windows users it
will work - since they use the binaries, and the binaries are built
with the full api - so we shouldn't make it *too* prominent..


-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2010-07-08 15:45:41
Subject: Re: [HACKERS] pgsql: Add support for TCP keepalives on Windows, both for backend and
Previous:From: Tom LaneDate: 2010-07-08 15:39:14
Subject: Re: pgsql: Add support for TCP keepalives on Windows, both for backend and

pgsql-committers by date

Next:From: Andrew DunstanDate: 2010-07-08 15:45:41
Subject: Re: [HACKERS] pgsql: Add support for TCP keepalives on Windows, both for backend and
Previous:From: Tom LaneDate: 2010-07-08 15:39:14
Subject: Re: pgsql: Add support for TCP keepalives on Windows, both for backend and

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group