RE: [HACKERS] LIBPQ for WIN32 - Mailing list pgsql-hackers

From Vince Vielhaber
Subject RE: [HACKERS] LIBPQ for WIN32
Date
Msg-id Pine.HPP.3.94.980929060501.7681C-100000@cinnamon.michvhf.com
Whole thread Raw
In response to RE: [HACKERS] LIBPQ for WIN32  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
List pgsql-hackers
On Tue, 29 Sep 1998, Hiroshi Inoue wrote:

> >
> > On 28-Sep-98 Hiroshi Inoue wrote:
> > > I think that current DLL supports version 1.0,1.1,2.0,2.1 and 2.2 and we
> > > can
> > > specify any version from 1.0 to 2.2 .
> > > For example,if we call WSAStartup(MAKEWORD(1.0),&wsaData) from libpq
> > > and call WSAStartup(MAKEWORD(2,2),&wsaData) from psql,both return OK
> > > and wsaData.wVersion is 1.0 for libpq and 2.2 for psql.
> >
> > Whichever is done, try not to ever request a version higher than what is
> > required.  It forces upgrades that may not even be necessary.  It's been
> > awhile since I've done windows code, but I've been bitten by requiring a
> > higher version of a library than necessary - more than once without even
> > realising it.  It's not very fun when it comes time to fix it.
> >
>
> How about my sample code at the end of my previous post.
> In that code,libpq does nothing if main application calls WSAStartup().

According to the winsock 1.1 spec an intermediate dll should handle it's
own startup and cleanup functions.  Thinking about it, you really have
no way of knowing if the app is going to stop using and unload winsock
if you're not done with it.  It may have loaded it for any number of
reasons not necessarily related to the database access.

Vince.
--
==========================================================================
Vince Vielhaber -- KA8CSH   email: vev@michvhf.com   flame-mail: /dev/null
       # include <std/disclaimers.h>                   TEAM-OS2
   Online Searchable Campground Listings    http://www.camping-usa.com
       "There is no outfit less entitled to lecture me about bloat
               than the federal government"  -- Tony Snow
==========================================================================




pgsql-hackers by date:

Previous
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Patch - please apply
Next
From: Magnus Hagander
Date:
Subject: RE: [HACKERS] LIBPQ for WIN32