pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: mlw <pgsql@mohawksoft.com>
To: Bruce Momjian <pgman@candle.pha.pa.us>
To: pgsql-hackers@postgresql.org
Subject: Re: close() vs. closesocket()
Date: Fri, 25 Apr 2003 08:29:29 -0400
Message-ID: <3EA92A29.3070708@mohawksoft.com> (raw)
References: <200304241835.h3OIZ2s04294@candle.pha.pa.us>

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 
SocketSelectRead(...).

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


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.
>
>Comments?
>
>  
>




view thread (15+ messages)  latest in thread

Message-ID: <3EA92A29.3070708@mohawksoft.com>
Permalink:  ../3EA92A29.3070708@mohawksoft.com/
Also on:    postgresql.org/message-id/3EA92A29.3070708@mohawksoft.com

 · 

reply

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-hackers@postgresql.org
  Cc: pgsql@mohawksoft.com, pgman@candle.pha.pa.us
  Subject: Re: close() vs. closesocket()
  In-Reply-To: <3EA92A29.3070708@mohawksoft.com>

* 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