[Top][All Lists]

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

[Patch-gnuradio] reworked gr_udp_{sink,source}

From: Don Ward
Subject: [Patch-gnuradio] reworked gr_udp_{sink,source}
Date: Thu, 6 May 2010 15:51:35 -0400

I have reworked gr_udp_{sink,source} to do the following:

* Make them work on Cygwin and MinGW (tested on Debian/lenny)

* Simplify usage: there is no need to specify the local host and port in
gr_udp_sink, since no one ever sends anything to it; the "src" and "dst"
designations on the host and port have been removed in the code and in the

* Add flexibility: get_port() in udp_source retrieves the port number,
which can be system-assigned; disconnect() and connect() in udp_sink allow
the destination address to be changed (e.g., to point to a socket opened by
a new client)

* Add EOF handling: udp_sink will send zero-length packets when
disconnecting; udp_source interprets zero-length packets as EOF and shuts
down the top_block gracefully; EOF handling can be disabled independently on
sink and source

* Add testing: a test case has been added to gnuradio-core/src/tests

* Fix miscellaneous problems: udp_source will wait for input, checking for
top_block.stop() without blocking; udp_sink ignores ECONNREFUSED errors
(allowing it to send quietly until a receiver is ready)

* Improved portability: system-dependent handling of errors has been
encapsulated in two short functions; select() has been used instead of
RCV_TIMEO (to make it work on Cygwin); newer getaddrinfo() replaces several
older functions

Outstanding issues:

* Two parameters (src_host and src_port) have been removed from the call to
gr.udp_sink().  Will this be a big problem?  Is there a way to effectively
provide overloaded function definitions (in Python)?  Is it worth it?

The new code can be found at in
branch udp.

Comments are welcome.

-- Don W.

reply via email to

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