discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Win32 and gr-blocks/lib/stream_pdu_base.cc


From: Josh Blum
Subject: Re: [Discuss-gnuradio] Win32 and gr-blocks/lib/stream_pdu_base.cc
Date: Sun, 05 Oct 2014 12:25:46 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1


On 10/05/2014 04:25 AM, Gisle Vanem wrote:
> Since my previous message seems to be ignored, here is something simpler
> for you to comment on.
> 
> In gr-blocks/lib/stream_pdu_base.cc, the read() and write() functions
> are used on sockets. This doesn't work well on Windows as you're
> probably aware. A simple fix is to has something like this at the top of
> this file:
> 
> #ifdef WIN32
>  #undef read
>  #undef write
>  #define read(sk,buf,len) ::recv (sk, (char*)(buf), len, 0)
>  #define write(sk,buf,len) ::send (sk, (const char*)(buf), len, 0)
> #endif
> 
> I'm sure Boost have some better fix for this, but I don't know
> Boost.

The issue is that the stream_pdu_base file descriptor is both a network
socket for socket_pdu and tuntap handle for tuntap_pdu. Calling ::recv()
and ::send() would be a good cross platform solution for the socket
case, but im not sure if that will work for the tuntap (which is linux
specific anyway).

Ideally we could switch the code to call send/recv, and the tuntap would
continue working -- this needs testing.

Your patch is pretty good too, because it doesnt interfere with existing
functionality, and the tuntap is ifdefed out on windows.

The best way to upstream patches seems to be through github. I recommend
creating a github pull request for this change, and some of the other
changes you mentioned in the previous email.

-josh

> 
> --gv
> 
> 
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio



reply via email to

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