X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1988E8B9B60 for ; Mon, 7 Feb 2005 15:05:17 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 72765-06 for ; Mon, 7 Feb 2005 15:05:03 +0000 (GMT) Received: from web11608.mail.yahoo.com (web11608.mail.yahoo.com [216.136.172.60]) by svr1.postgresql.org (Postfix) with SMTP id 6CB488B9E58 for ; Mon, 7 Feb 2005 15:05:04 +0000 (GMT) Received: (qmail 14255 invoked by uid 60001); 7 Feb 2005 15:05:04 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=6hIhjGrZLx2h+uiWkLKbeezA49oTxt19yTSk5ipHYa5rIg+l567oMWBW/sthI6HeEv0E8PDhVAgqMdG7DZhT3OjHs+YVOAJSYuch/zoZF50QRpCG1Mu51kV4kRz/aLeoohxqPOppS3UZMe98RgPx2u0aevfoVeVouNDNt7vRevI= ; Message-ID: <20050207150504.14253.qmail@web11608.mail.yahoo.com> Received: from [206.53.65.228] by web11608.mail.yahoo.com via HTTP; Mon, 07 Feb 2005 07:05:04 PST Date: Mon, 7 Feb 2005 07:05:04 -0800 (PST) From: Chad Robinson Subject: Problem with asynchronous connect in 8.0.1 To: pgsql-interfaces@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.374 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200502/15 X-Sequence-Number: 5260 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> 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