[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to notice abrupt tcp connection losses in server/client?
From: |
Chris Vine |
Subject: |
Re: How to notice abrupt tcp connection losses in server/client? |
Date: |
Fri, 22 Jun 2018 11:07:39 +0100 |
On Fri, 22 Jun 2018 09:27:30 +0300
Eli Zaretskii <address@hidden> wrote:
> > 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.
OK, my misunderstanding then. Looking at the wrappers for windows
sockets (lib/socket.c) it looks as if it may work - since you use
windows and I don't, why not try it and tell us?