Problem with asynchronous connect in 8.0.1

From: Chad Robinson <taskswap(at)yahoo(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Problem with asynchronous connect in 8.0.1
Date: 2005-02-07 15:05:04
Message-ID: 20050207150504.14253.qmail@web11608.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2005-02-07 16:21:27 Re: Problem with asynchronous connect in 8.0.1
Previous Message Bruno Wolff III 2005-02-07 14:35:55 Re: [despammed] How to search for a subString