Skip site navigation (1) Skip section navigation (2)

Asynchronous connection functions - patch submitted

From: eem21(at)cam(dot)ac(dot)uk
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Asynchronous connection functions - patch submitted
Date: 1999-11-30 02:35:46
Message-ID: E11sd74-0000dN-00@orange.csi.cam.ac.uk (view raw or flat)
Thread:
Lists: pgsql-interfaces
Due to enormous public demand, I have now submitted the changes to
libpq that I have had hold of for some time.  These add functions to
allow asynchronous connection to the database.  These functions are
called

PQconnectStart
PQconnectPoll
PQresetStart
PQresetPoll

I've also added

PQsetenvStart
PQsetenvPoll
PQsetenvAbort
PQsetenv

Documentation is available, so hopefully anyone interested should be
able to make them work.  There are a number of problems at the moment:

  o  The Windows code does not default to using non-blocking sockets.  I
  have no WinSock documentation, and no way of compiling Windows
  applications, so I've had to leave this stuff turned off under
  Windows.  I did ask on this list some time back for a volunteer
  willing to try it for me, but none was forthcoming.  Perhaps
  someone will try it, now that it is in CVS? Define
  WIN32_NON_BLOCKING_CONNECTIONS during compilation to activate the
  code.

  o  USE_SSL.  In between me writing this and me checking it in (that's
  been a long time) someone has written code to talk over SSL.  This
  code is non-reentrant. *grumble*.  It also has this comment:

/* This needs to be done before we set into nonblocking, since SSL negotiation
 * does not like that mode */

  I have no idea what this means, and no time to find out at the moment
  - perhaps someone could try and fix this.  For now, non-blocking
  connections and SSL are mutually exclusive.

  o  None of these functions are thread-safe.  Although I've not added
  any re-entrancy horrors, I've not taken any out either.  These have
  been heavily discussed on this list of late.  This is a bit of a
  shame, but I don't have time to fix the underlying problem (the
  option parsing bits, mainly).

The PQsetenvXxx functions were made public by one vote to zero on this
list.  I'm not sure if anyone's actually going to use them though. 
They might be useful for those interested in MB issues at the user end
- perhaps Tatsuo, Oleg, or Oleg could give an idea as to why they might
be useful.  Otherwise, these could well be earmarked for removal in 7.0
;-)

That's it, I think.  Comments welcome.

Ewan.



Responses

pgsql-interfaces by date

Next:From: Byron NikolaidisDate: 1999-11-30 04:23:55
Subject: VBA and ODBC (was Re: [INTERFACES] RE: pgsql-interfaces-digest V1 #562)
Previous:From: eem21Date: 1999-11-30 02:18:02
Subject: Re: [INTERFACES] libpq + multiple connections ...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group