gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] [PATCH 3/3] Enable Windows version of gpspipe


From: Fred Wright
Subject: Re: [gpsd-dev] [PATCH 3/3] Enable Windows version of gpspipe
Date: Sun, 5 Mar 2017 13:33:52 -0800 (PST)

On Sun, 5 Mar 2017, Robert Norris wrote:

> >> Use recv() rather than read() for Windows compatibility.
>
> > This seems like a good idea in general, though again it would be better to
> > confine the conditional include stuff to os_compat.h.
>
> This isn't a conditional. Using recv() with a 0 for the third parameter is 
> equivalent to using read().

Yes, I know.  I said "conditional include".  Maybe I should have said
"conditional #include". :-)

> However on Windows read() doesn't work with sockets, hence the need to use 
> recv() instead.

Indeed.  Using send()/recv() is perfectly reasonable in contexts known to
be sockets, while write()/read() are better for "genric stream I/O".

> select() on Windows is available via winsock2.h

OK, if that's the official place to get the definitions.  Windows wouldn't
be the only platform that kludged in BSD sockets as an afterthought and
implemented select() just for sockets, rather than for general file
descriptors.

> NB with the syslog compatibility patch (which I'll rework as requested)
> - gpxlogger builds without further changes.

Did you also try running it (to test my SIGQUIT fix)?

Fred Wright



reply via email to

[Prev in Thread] Current Thread [Next in Thread]