[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to notice abrupt tcp connection losses in server/client?
From: |
Eli Zaretskii |
Subject: |
Re: How to notice abrupt tcp connection losses in server/client? |
Date: |
Fri, 22 Jun 2018 09:27:30 +0300 |
> Date: Fri, 22 Jun 2018 00:09:16 +0100
> From: Chris Vine <address@hidden>
>
> I think you will need to use recv! with windows, because you cannot
> read from sockets in windows using POSIX read().
What makes you say that? It isn't true; Gawk does that on Windows,
and it works very well. The only two issues, which are easy to
overcome with wrappers or macros, are:
. you need to create the socket with 'WSASocket; rather than
'socket', since the latter creates overlapped sockets that cannot
be used with file I/O APIs;
. you need to convert the SOCKET type (which is a handle in
disguise) into a file descriptor and back using a pair of library
functions
Perhaps Guile doesn't yet do that (I didn't look, it could be in
Gnulib functions), but it would be easy to add if so.