Thread: Asynchronous connection functions - patch submitted

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.



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




Re: [INTERFACES] Asynchronous connection functions - patch submitted

From
Tatsuo Ishii
Date:
> 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
> ;-)

For the multi-byte support, setting an envrionment variable
(PGCLIENTENCODING) inside libpq is just a dirty trick and should be
eliminated. It's on my TODO list for 7.0.
--
Tatsuo Ishii


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




Re: [INTERFACES] Asynchronous connection functions - patch submitted

From
Tatsuo Ishii
Date:
> 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
> ;-)

For the multi-byte support, setting an envrionment variable
(PGCLIENTENCODING) inside libpq is just a dirty trick and should be
eliminated. It's on my TODO list for 7.0.
--
Tatsuo Ishii


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




Re: [INTERFACES] Asynchronous connection functions - patch submitted

From
Michael Meskes
Date:
On Tue, Nov 30, 1999 at 02:35:46AM +0000, eem21@cam.ac.uk wrote:
> 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
> ...

Sorrym I didn't follow this discussion. Do these function replace the old
ones? Or are they additional?

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!

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




Re: [INTERFACES] Asynchronous connection functions - patch submitted

From
"E.E. Mellor"
Date:
On Tue, 30 Nov 1999, Michael Meskes wrote:

> On Tue, Nov 30, 1999 at 02:35:46AM +0000, eem21@cam.ac.uk wrote:
> > 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
> > ...
> 
> Sorrym I didn't follow this discussion. Do these function replace the old
> ones? Or are they additional?

Additional.  The old functions (PQconnect, PQreset) now actually feed
through these new functions, but there should be no change in behaviour as
far as any caller of those is concerned.

Ewan.



Re: [INTERFACES] Asynchronous connection functions - patch submitted

From
Michael Meskes
Date:
On Tue, Nov 30, 1999 at 12:12:42PM +0000, E.E. Mellor wrote:
> Additional.  The old functions (PQconnect, PQreset) now actually feed
> through these new functions, but there should be no change in behaviour as
> far as any caller of those is concerned.

I see. Thanks.

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!

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




Re: [INTERFACES] Asynchronous connection functions - patch submitted

From
Michael Meskes
Date:
On Tue, Nov 30, 1999 at 12:12:42PM +0000, E.E. Mellor wrote:
> Additional.  The old functions (PQconnect, PQreset) now actually feed
> through these new functions, but there should be no change in behaviour as
> far as any caller of those is concerned.

I see. Thanks.

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!

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




Re: [INTERFACES] Asynchronous connection functions - patch submitted

From
Michael Meskes
Date:
On Tue, Nov 30, 1999 at 02:35:46AM +0000, eem21@cam.ac.uk wrote:
> 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
> ...

Sorrym I didn't follow this discussion. Do these function replace the old
ones? Or are they additional?

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!

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