summaryrefslogtreecommitdiff
path: root/gnuradio-core/src
diff options
context:
space:
mode:
authorEric Blossom2010-05-19 20:15:41 -0700
committerEric Blossom2010-05-19 20:15:41 -0700
commit34e0be1f96cb24e302269c008444bc18e418b653 (patch)
tree8f04514943e5567750eda7a6d8b9947c663e0eba /gnuradio-core/src
parent1e963cd9b6e2a1687bbff86df66c5efbcb2be363 (diff)
downloadgnuradio-34e0be1f96cb24e302269c008444bc18e418b653.tar.gz
gnuradio-34e0be1f96cb24e302269c008444bc18e418b653.tar.bz2
gnuradio-34e0be1f96cb24e302269c008444bc18e418b653.zip
Move initialization of select timeout
Diffstat (limited to 'gnuradio-core/src')
-rwxr-xr-xgnuradio-core/src/lib/io/gr_udp_source.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gnuradio-core/src/lib/io/gr_udp_source.cc b/gnuradio-core/src/lib/io/gr_udp_source.cc
index cc9849280..f8727c4dc 100755
--- a/gnuradio-core/src/lib/io/gr_udp_source.cc
+++ b/gnuradio-core/src/lib/io/gr_udp_source.cc
@@ -250,8 +250,6 @@ gr_udp_source::work (int noutput_items,
// Use select() to determine when socket is readable
fd_set readfds;
timeval timeout;
- timeout.tv_sec = 1;
- timeout.tv_usec = 0;
#endif
while(1) {
@@ -260,6 +258,8 @@ gr_udp_source::work (int noutput_items,
#if USE_SELECT
// RCV_TIMEO doesn't work on all systems (e.g., Cygwin)
// use select() instead of, or in addition to RCV_TIMEO
+ timeout.tv_sec = 1; // Init timeout each iteration. Select can modify it.
+ timeout.tv_usec = 0;
FD_ZERO(&readfds);
FD_SET(d_socket, &readfds);
r = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout);