Re: support for keep alive option

From: PG User <pguser1982(at)gmail(dot)com>
To: Barry Bell <Barry(dot)Bell(at)hartehanks(dot)com>
Cc: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: support for keep alive option
Date: 2013-12-17 23:25:27
Message-ID: CAB7tN8bPUWg6ATqW5F5TCg+5O4ANsOYC6jyMKhhDuBR-JOBefA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi Barry,
Thank you for reply.
I am little bit confused.

I saw the code for JDBC code and it sets true to
newStream.getSocket().setKeepAlive(requireTCPKeepAlive);
if ?tchKeepAlive=true is given.

But, in socket.c of odbc driver, in
char
SOCK_connect_to(SocketClass *self, unsigned short port, char *hostname,
long timeout)

Can we just do the same thing?:
setsockopt(self->socket, IPPROTO_TCP, TCP_KEEPALIVE, (char *) &i, len);

as did in the same function:

if (setsockopt(self->socket, IPPROTO_TCP, TCP_NODELAY, (char *) &i, len) <
0) { SOCK_set_error(self, SOCKET_COULD_NOT_CONNECT, "Could not set socket
to NODELAY."); closesocket(self->socket); self->socket = (SOCKETFD) -1;
return 0; }

- Nachiket

On Tue, Dec 17, 2013 at 1:29 PM, Barry Bell <Barry(dot)Bell(at)hartehanks(dot)com>wrote:

> The “keep alive” option is set inside the client, not the driver,
>
> What ever programing language you are using may have a keep alive ( and
> timeout settings) for the OBDC driver.
>
>
>
> *Barry Bell*
>
> Senior Developer/Analyst, Harte Hanks Logsitics
>
> Harte Hanks, Inc.
>
>
>
> Office: 954*-429-3771 Ext 267 *Barry(dot)Bell(at)hartehanks(dot)com
>
> 1525 NW 3rd ST, Deerfield Beach, FL 33442
>
> <https://www.facebook.com/HarteHanks>
>
> <https://twitter.com/HarteHanks>
>
> <http://www.linkedin.com/company/hartehanks>
>
>
>
>
>
>
>
> *www.hartehanks.com <http://www.hartehanks.com/>*
>
>
>
>
>
>
>
> *From:* pgsql-odbc-owner(at)postgresql(dot)org [mailto:
> pgsql-odbc-owner(at)postgresql(dot)org] *On Behalf Of *PG User
> *Sent:* Tuesday, December 17, 2013 4:27 PM
> *To:* pgsql-odbc(at)postgresql(dot)org
> *Subject:* [ODBC] support for keep alive option
>
>
>
> Hi,
>
> I looking at code and found that there is an option for tpch keep alive in
> jdbc driver but there is no such support in odbc driver.
>
> Is there any plan to support that in near future?
>
>
>
> Thanking you.
>
>
>
> - pguser
>

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Daniel Homerick 2013-12-18 00:48:32 Length of bytea
Previous Message PG User 2013-12-17 21:26:57 support for keep alive option