From: Hiroshi Inoue <Inoue@tpf.co.jp>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Magnus Hagander <mha@sollentuna.net>
Cc: 'David Giffin' <david@agent911.com>
Cc: Ken J. Wright <ken@ori-ind.com>
Cc: pgsql-interfaces@postgreSQL.org
Subject: RE: [INTERFACES] Win32 interface
Date: Mon, 6 Sep 1999 13:37:08 +0900
Message-ID: <000201bef821$7a95cf00$2801007e@cadzone.tpf.co.jp> (raw)
In-Reply-To: <24150.936458459@sss.pgh.pa.us>
> -----Original Message-----
> From: owner-pgsql-interfaces@postgreSQL.org
> [mailto:owner-pgsql-interfaces@postgreSQL.org]On Behalf Of Tom Lane
> Sent: Sunday, September 05, 1999 12:21 AM
> To: Magnus Hagander
> Cc: 'David Giffin'; Ken J. Wright; pgsql-interfaces@postgreSQL.org
> Subject: Re: [INTERFACES] Win32 interface
>
>
> Magnus Hagander <mha@sollentuna.net> writes:
> > The problem is that in the DllMain() of the libpq.dll file,
> WSAStartup() is
> > called, and that is required before any winsock functions will work.
> > If you link statically, you have to manually run WSAStartup.
> >
> > This should probably be documented :-)
>
> Didn't we talk about having fe-connect.c call WSAStartup()
> (conditionally compiled of course) to avoid this problem?
>
Sorry,I forgot to take static link cases into account when I proposed
to call WSAStartup() in DllMain().
> ISTM there was some reason it wouldn't work, like maybe you can
> only call WSAStartup once per program, but I don't recall for sure.
We can call WSAStartup() more than once. However,there must be a
call to WSACleanup() for every successful call to WSAStartup()
made by a task. Only the final WSACleanup() for that task does the
actual cleanup.
.
The simplest way may be to call WSAStartup() while connecting and
to call WSACleanup() while finishing(including error cases).
Regards.
Hiroshi Inoue
Inoue@tpf.co.jp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: Inoue@tpf.co.jp, tgl@sss.pgh.pa.us, mha@sollentuna.net, david@agent911.com, ken@ori-ind.com
Subject: RE: [INTERFACES] Win32 interface
In-Reply-To: <000201bef821$7a95cf00$2801007e@cadzone.tpf.co.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox