The problem i am facing is that PQconnectdb is blocking even though i specified connect_timeout=10. My observation is below.
1. To simulate this issue, i stopped the postgreSQL-x64-9.4 service and executed my application.4. My application doesn't blocks, the PQconnectDB fails instantaneously but when ran as a service PQconnectDB blocks. No difference in code and environment between exe and service.