Problem with asynchronous connect in 8.0.1 - Mailing list pgsql-interfaces

From Chad Robinson
Subject Problem with asynchronous connect in 8.0.1
Date
Msg-id 20050207150504.14253.qmail@web11608.mail.yahoo.com
Whole thread Raw
Responses Re: Problem with asynchronous connect in 8.0.1  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 


pgsql-interfaces by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: [despammed] How to search for a subString
Next
From: Tom Lane
Date:
Subject: Re: Problem with asynchronous connect in 8.0.1