Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by hub.org (8.9.3/8.9.3) with ESMTP id EAA74785 for ; Tue, 7 Sep 1999 04:12:57 -0400 (EDT) (envelope-from Inoue@tpf.co.jp) Received: from cadzone ([126.0.1.40] (may be forged)) by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with SMTP id RAA06635; Tue, 07 Sep 1999 17:11:50 +0900 From: "Hiroshi Inoue" To: "Magnus Hagander" , "'Tom Lane'" Cc: Subject: RE: [INTERFACES] Win32 interface Date: Tue, 7 Sep 1999 17:15:05 +0900 Message-ID: <000701bef909$17763fc0$2801007e@cadzone.tpf.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <215896B6B5E1CF11BC5600805FFEA82101F71092@sirius.edu.sollentuna.se> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 > > > >> 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@tpf.co.jp