From: Chad Robinson <taskswap@yahoo.com>
To: pgsql-interfaces@postgresql.org
Subject: Problem with asynchronous connect in 8.0.1
Date: Mon, 7 Feb 2005 07:05:04 -0800 (PST)
Message-ID: <20050207150504.14253.qmail@web11608.mail.yahoo.com> (raw)
I'm having a problem with asynchronous connections, and I can't seem to find
a good example of this anywhere. To make things simple, I've reduced my
program to the bare minimums, not even using select(). Here's my program
flow:
1. Call PQconnectStart. I'm told CONNECTION_STARTED.
2. Sleeping 300ms in between calls, call PQconnectPoll.
The FIRST time I call this I'm told CONNECTION_STARTED and
PGRES_POLLING_WRITING. Every additional time I call this I'm told
CONNECTION_SSL_STARTUP and PGRES_POLLING_READING. It never leaves this state,
and goes on in an infinite loop until I kill the attempt.
In my Postgres logs I see:
LOG: incomplete startup packet
If I PQtrace the connection I see:
To backend> Msg
To backend> <binary junk>
To backend> Msg complete, length 8
What could be going on? Incidentally, the only thing I found that comes close
is a pg_ping tool posted by another user, and that does the same thing. Yet
psql works fine using the same connection parameters, and if I rewrite my
program to use blocking functions, it works too.
This is with Postgres 8.0.1 using TCP/IP connections over a local LAN.
Thanks,
Chad
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: taskswap@yahoo.com
Subject: Re: Problem with asynchronous connect in 8.0.1
In-Reply-To: <20050207150504.14253.qmail@web11608.mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox