Re: TCP keepalive support for libpq - Mailing list pgsql-hackers

From Kris Jurka
Subject Re: TCP keepalive support for libpq
Date
Msg-id alpine.BSO.2.00.1002111214450.17942@leary.csoft.net
Whole thread Raw
In response to Re: TCP keepalive support for libpq  (Andrew Chernow <ac@esilo.com>)
List pgsql-hackers

On Thu, 11 Feb 2010, Andrew Chernow wrote:

>
> Although, I think Dave's comments have made me change my mind about this 
> patch.  Looks like it serves a good purpose.  That said, there is no 
> guarentee the driver will implement the new feature ... JDBC seems to 
> lack the ability to get the backing Socket object but java can set 
> socket options. Maybe a JDBC kong fu master knows how to do this.

Use the tcpKeepAlive connection option as described here:

http://jdbc.postgresql.org/documentation/84/connect.html#connection-parameters

Java can only enable/disable keep alives, it can't set the desired 
timeout.

http://java.sun.com/javase/6/docs/api/java/net/Socket.html#setKeepAlive%28boolean%29

Kris Jurka


pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: TCP keepalive support for libpq
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Bug on pg_lesslog