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

Re: Keep-alive support

From: Tomasz Myrta <jasiek(at)klaster(dot)net>
To: Leandro Lucarella <llucarella(at)integratech(dot)com(dot)ar>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Keep-alive support
Date: 2006-11-29 20:31:57
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-interfaces
Leandro Lucarella napisal 2006-11-29 20:49:
> Is there any keep alive support in libpq? I'm not really using libpq 
> directly, I'm using libpqxx and there is no keep-alive support there, 
> so I'm trying to use TCP's own keep-alive support, but I have a 
> problem: libpq seems to reconnect the socket when the connection is lost.
>  In the sleep time I unplug the network cable and monitor the TCP 
> connection using netstat -pano, and found all the TCP keep-alive 
> timers times out perfectly, closing the connection, but inmediatly I 
> see a new connection (and without the keep-alive parameters, so it 
> take forever to timeout again). So I guess libpq is re-opening the 
> socket. This is making my life a nightmare =)
I used keepalive the same way as you (reconfiguring socket directly) and 
I don't remember libpq trying to reconnect itself. I think it's a 
libpqxx's behaviour - I didn't use it, but it looks like it is called 

Tomasz Myrta

In response to


pgsql-hackers by date

Next:From: Pavel StehuleDate: 2006-11-29 20:34:40
Subject: Re: small bug in to_char and TM prefix, in RC
Previous:From: Tom LaneDate: 2006-11-29 20:28:16
Subject: Re: small bug in to_char and TM prefix, in RC

pgsql-interfaces by date

Next:From: Jeroen T. VermeulenDate: 2006-11-30 06:33:03
Subject: Re: Keep-alive support
Previous:From: Tom LaneDate: 2006-11-29 20:18:37
Subject: Re: Keep-alive support

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