# Bug in GRC's tcp\_source block

**URL:** <https://www.ruby-forum.com/t/bug-in-grcs-tcp-source-block/246082>\
**Category:** GNU Radio\
**Created:** [August 29, 2013, 10:53am UTC](https://www.ruby-forum.com/t/bug-in-grcs-tcp-source-block/246082 "2013-08-29T10:53:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [August 29, 2013, 10:53am UTC](https://www.ruby-forum.com/t/bug-in-grcs-tcp-source-block/246082/1 "2013-08-29T10:53:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 29, 2013, 3:56pm UTC](https://www.ruby-forum.com/t/bug-in-grcs-tcp-source-block/246082/2 "2013-08-29T15:56:56Z")

</div>

On Thu, Aug 29, 2013 at 4:51 AM, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

> **[GNU Radio Conference 2013 — Rondeau Research](http://www.trondeau.com/gnu-radio-conference-2013)**

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 29, 2013, 4:27pm UTC](https://www.ruby-forum.com/t/bug-in-grcs-tcp-source-block/246082/3 "2013-08-29T16:27:18Z")

</div>

Tom R. writes:

> On Thu, Aug 29, 2013 at 4:51 AM, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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](http://www.trondeau.com/grcon13)

OK, cool.

Thanks,

Matt
