Thread: [INTERFACES] Asynchronous connection functions - patch submitted

[INTERFACES] Asynchronous connection functions - patch submitted

From
eem21@cam.ac.uk
Date:
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
compilingWindows applications, so I've had to leave this stuff turned off under Windows.  I did ask on this list some
timeback for a volunteer willing to try it for me, but none was forthcoming.  Perhaps someone will try it, now that it
isin 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
talkover 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
theunderlying 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.



************