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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Keep-alive support



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.
<cut>
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 "reactivation".

Regards,
Tomasz Myrta



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group