Bug in GRC's tcp_source block

Hi,

I’ve now come across another issue with version 3.7. If I have a tcp
source block in gnuradio-companion (in client mode), I get a
stacktrace like this:

Using Volk machine: sse4_a_64_orc
Traceback (most recent call last):
File “/home/matt/devel/mygnuradio/client2.py”, line 86, in
tb = client2()
File “/home/matt/devel/mygnuradio/client2.py”, line 59, in init
server=False,
File “/usr/lib/python2.7/dist-packages/grc_gnuradio/blks2/tcp.py”,
line 59, in init
self.connect(blocks.file_descriptor_source(itemsize, fd), self)
File
“/usr/lib/python2.7/dist-packages/gnuradio/blocks/blocks_swig0.py”, line
766, in make
return _blocks_swig0.file_descriptor_source_make(*args, **kwargs)
TypeError: Required argument ‘repeat’ (pos 3) not found

(for info grc builds the source like this:
self.blks2_tcp_source_0 = grc_blks2.tcp_source(
itemsize=gr.sizeof_gr_complex*1,
addr=“127.0.0.1”,
port=7840,
server=False,
)
)

From my quick look at this, it appears that grc_gnuradio/blks2/tcp.py
should be changes so that line 59 goes from:

    self.connect(blocks.file_descriptor_source(itemsize, fd), self)

to be:

    self.connect(blocks.file_descriptor_source(itemsize, fd, False), 

self)

as it appears that all source file descriptors need to have a bool that
shows if they should repeat or not - and to me at least, it made no
sense to have a TCP stream repeat.

Thanks,

Matt

On Thu, Aug 29, 2013 at 4:51 AM, [email protected] wrote:

  tb = client2()
         itemsize=gr.sizeof_gr_complex*1,
    self.connect(blocks.file_descriptor_source(itemsize, fd), self)

Thanks,

Matt

Actually, I think the bug is in file_descriptor_source. That final
argument for repeat should default to false, like it did in 3.6. The
default setting wasn’t carried over with the refactoring in 3.7. I’ll
push this fix in a bit.


Tom
Visit us at GRCon13 Oct. 1 - 4
http://www.trondeau.com/grcon13

Tom R. writes:

On Thu, Aug 29, 2013 at 4:51 AM, [email protected] wrote:

Hi,

I’ve now come across another issue with version 3.7. If I have a
tcp
source block in gnuradio-companion (in client mode), I get a
stacktrace like this:

Using Volk machine: sse4_a_64_orc
Traceback (most recent call last):
File “/home/matt/devel/mygnuradio/client2.py”, line 86, in

tb = client2()
File “/home/matt/devel/mygnuradio/client2.py”, line 59, in
init
server=False,
File
“/usr/lib/python2.7/dist-packages/grc_gnuradio/blks2/tcp.py”, line 59,
in init
self.connect(blocks.file_descriptor_source(itemsize, fd),
self)
File
“/usr/lib/python2.7/dist-packages/gnuradio/blocks/blocks_swig0.py”, line
766, in make
return _blocks_swig0.file_descriptor_source_make(*args,
**kwargs)
TypeError: Required argument ‘repeat’ (pos 3) not found

(for info grc builds the source like this:
self.blks2_tcp_source_0 = grc_blks2.tcp_source(
itemsize=gr.sizeof_gr_complex*1,
addr=“127.0.0.1”,
port=7840,
server=False,
)
)

From my quick look at this, it appears that
grc_gnuradio/blks2/tcp.py
should be changes so that line 59 goes from:

    self.connect(blocks.file_descriptor_source(itemsize, fd), 

self)

to be:

    self.connect(blocks.file_descriptor_source(itemsize, fd, 

False), self)

as it appears that all source file descriptors need to have a bool
that
shows if they should repeat or not - and to me at least, it made no
sense to have a TCP stream repeat.

Thanks,

Matt

Actually, I think the bug is in file_descriptor_source. That final
argument for repeat should default to false, like it did in 3.6. The
default setting wasn’t carried over with the refactoring in 3.7. I’ll
push this fix in a bit.


Tom
Visit us at GRCon13 Oct. 1 - 4
GNU Radio Conference 2013 — Rondeau Research

OK, cool.

Thanks,

Matt