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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-interfaces by date

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