X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 77563529A1 for ; Thu, 30 Jun 2005 06:37:18 -0300 (ADT) 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 74778-01 for ; Thu, 30 Jun 2005 09:37:09 +0000 (GMT) Received: from smtp.nildram.co.uk (smtp.nildram.co.uk [195.112.4.54]) by svr1.postgresql.org (Postfix) with ESMTP id 43285529E2 for ; Thu, 30 Jun 2005 06:37:08 -0300 (ADT) Received: from HYDROGEN (unknown [62.3.216.34]) by smtp.nildram.co.uk (Postfix) with ESMTP id 3A198252676 for ; Thu, 30 Jun 2005 10:37:09 +0100 (BST) From: "Nick Stone" To: Subject: Pqsocket not implemented in PHP Date: Thu, 30 Jun 2005 10:35:06 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Thread-Index: AcV9VwAs4PPTjE8NSFWOB8e3VANcvA== Message-Id: <20050630093709.3A198252676@smtp.nildram.co.uk> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200506/25 X-Sequence-Number: 3184 Hi, I tried this question on the PHP lists but didn't get anywhere so I'm hoping you maybe able to help. I'm currently implementing a standalone app using php cli. Part of the app connects to Postgres and waits for a notification using the "Listen " SQL. In the postgres C lib there is a function called "Pqsocket" which returns the file-descriptor of the socket connection to Postgres. With this I can use a simple select server to sleep on this interface and others in the application. Does anybody now of a patch to make this available under PHP or does the structure of PHP code effectively make this type approach impossible? Alternatively if I've just missed the function would somebody point me in the right direction - I was kind of hoping (until I read the man pages more closely) that pg_port was the function that wrapped the Pqsocket command but sadly not! If I need to wite one then I'll do that and post it back if that's useful but just in case somebody has done it before... Thanks Nick