RE: [INTERFACES] Win32 interface

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "Magnus Hagander" <mha(at)sollentuna(dot)net>, "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: RE: [INTERFACES] Win32 interface
Date: 1999-09-07 08:15:05
Message-ID: 000701bef909$17763fc0$2801007e@cadzone.tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

>
> > >> 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).
> >
> > That would be an easy change. Are these functions fast enough that
> > calling them for every connect/disconnect cycle would be tolerable?
>
> I beleive so. But we could probably get away from that using static
> variables, no? Somewhere just put:
>
> static int has_wsastartup = 0;
>
> ...
>
> if (!has_wsastartup) {
> has_wsastartup = 1;
> WSAStartup()...
> }
>
>
> That way, it would only be run once, right?
> Naturally, everything within #ifdef WIN32.
>

I don't object to your solution.

WSACleanup() is never called.
But no one would care about such a thing.

Regards.

Hiroshi Inoue
Inoue(at)tpf(dot)co(dot)jp

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Jelle Ruttenberg 1999-09-07 09:06:20 Problem connecting NT-psqlODBC to Linux-PostgreSQL
Previous Message Andrew O'Callaghan 1999-09-07 07:27:17 insert interface