projects
/
debian
/
gnuradio
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1e963cd
)
Move initialization of select timeout
author
Eric Blossom
<eb@comsec.com>
Thu, 20 May 2010 03:15:41 +0000
(20:15 -0700)
committer
Eric Blossom
<eb@comsec.com>
Thu, 20 May 2010 03:15:41 +0000
(20:15 -0700)
gnuradio-core/src/lib/io/gr_udp_source.cc
patch
|
blob
|
history
diff --git
a/gnuradio-core/src/lib/io/gr_udp_source.cc
b/gnuradio-core/src/lib/io/gr_udp_source.cc
index cc98492805914e34a5d2e263731b19c5772b0389..f8727c4dc959231d909cf95032b8ea0ff74ef92b 100755
(executable)
--- 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;
// Use select() to determine when socket is readable
fd_set readfds;
timeval timeout;
- timeout.tv_sec = 1;
- timeout.tv_usec = 0;
#endif
while(1) {
#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
#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);
FD_ZERO(&readfds);
FD_SET(d_socket, &readfds);
r = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout);