On Thu, 16 Oct 2003, Jim Jagielski wrote:
> Forwarded message:
> > * Bugz: #22805
> > - Jim is working on a somewhat revised patch which also
> > - uses closesocket() universally (instead of the places
> > - where we do #ifdef BEOS...). Only the changes to buff.c
> > - are being considered at this time.
> > + Jim is considering just the buff.c patches in addition
> > + to cleanup of http_main.c where we wrap close/closesocket
> > + around '#ifdef BEOS' which does not seem correct. Under
> > + Unix, we define closesocket as close, and isn't closesocket
> > + what we should be using for Win32 and Netware as well?
> >
>
> Comments from the Win32 and Netware people??
Note that the semantics of the UNIX close as applied to
sockets differ from Win32's closesocket. If you want to
emulate the UNIX close on Win32, there is more to it than
just calling closesocket. Otherwise, visible data loss will
occur.
Relevant MSDN quote[1]
"To assure that all data is sent and received on a
connection, an application should call shutdown before
calling closesocket (see Graceful shutdown, linger
options, and socket closure[2] for more information).
[1]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/closesocket_2.asp
[2]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/graceful_shutdown_linger_options_and_socket_closure_2.asp
- Sascha