patch-gnuradio
[Top][All Lists]
Advanced

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

[Patch-gnuradio] fixes for gr_udp_{source, sink} on Cygwin and MinGW (an


From: Don Ward
Subject: [Patch-gnuradio] fixes for gr_udp_{source, sink} on Cygwin and MinGW (and Linux)
Date: Tue, 20 Apr 2010 11:53:20 -0400

I have enhanced gr_udp_{source,sink}.{h,cc} to work on Cygwin and MinGW.

The main changes were for using Winsock 2 on MinGW (setup and cleanup after
Winsock DLL; fetch and interpret Winsock error codes; different type for
timeout value option in setsockopt).

Cygwin requires that the ENOPROTOOPT error be ignored when setting SO_LINGER
(Cygwin doesn't recognize this option for SOCK_DGRAM sockets).

It also seemed like a good idea to close the sockets when done with them.

After making dial_tone_{source,sink}.py work on Cygwin and MinGW, I found
they didn't work on Linux (Debian/lenny).  If gr_udp_sink (in
dial_tone_source.py) is started first it exits after receiving the
ECONNREFUSED return from send(), and if gr_udp_source (in dial_tone_sink.py) is started first it exits when it fails to receive data from the socket. My solution is to ignore the ECONNREFUSED return from send() in gr_udp_sink.cc.

I also simplied the code and removed some platform dependencies by using
getaddrinfo() instead of gethostbyname(), inet_aton(), inet_addr(), and
htons().  I hope that these changes can be tested on other systems before
release.

I also added #include <boost/bind.hpp> usrp2.h (boost::build was
undeclared).

The changes are available at git://github.com/don2387ward/gnuradio-dward.git
in branch udp; see the wiki there for more details.

-- Don W.





reply via email to

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