Skip site navigation (1) Skip section navigation (2)

Re: close() vs. closesocket()

From: mlw <pgsql(at)mohawksoft(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>,pgsql-hackers(at)postgresql(dot)org
Subject: Re: close() vs. closesocket()
Date: 2003-04-25 12:29:29
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
In porting to Windows, I would create a new source file called pgsocket, 
or something, and implement *all* the socket cruft there. Where ever you 
mess with a socket, i.e. send, recv,  poll,  accept, listen, 
get/setsockopt, select, etc. make it a function. Furthermore, try to 
bring some of the logical cruft that goes along with sockets and bring 
it into the module, i.e. don't call select(...) then call recv, call 

Windows' sockets aren't very good. They will be good enough to be 
functional, but eventually, someone will want to rewrite with completion 

Bruce Momjian wrote:

>Looking at libpq, you can see Win32 requires closesocket() while Unix
>uses just uses close().
>I have to add this type of change to the backend for Win32, so I am
>inclined to make all the socket close calls closesocket() and #define
>that as close() on Unix?  It would remove quite a few Win32 defs from
>libpq too.

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2003-04-25 14:01:44
Subject: Re: STABLE functions
Previous:From: Olleg SamojlovDate: 2003-04-25 12:04:06
Subject: Re: default locale considered harmful? (was Re: [GENERAL] Using

pgsql-patches by date

Next:From: Tom LaneDate: 2003-04-25 14:10:23
Subject: Re: close() vs. closesocket()
Previous:From: Shridhar DaithankarDate: 2003-04-25 06:35:08
Subject: Re: close() vs. closesocket()

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group