# Transmit stream tags via socket

**URL:** <https://www.ruby-forum.com/t/transmit-stream-tags-via-socket/242475>\
**Category:** GNU Radio\
**Created:** [June 26, 2015, 7:30am UTC](https://www.ruby-forum.com/t/transmit-stream-tags-via-socket/242475 "2015-06-26T07:30:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [June 26, 2015, 7:30am UTC](https://www.ruby-forum.com/t/transmit-stream-tags-via-socket/242475/1 "2015-06-26T07:30:21Z")

</div>

Hello list,

I kindly ask for an idea how to transmit a pmt::cons via a tcp (or udp)  
connection? Alternatively I want to transmit tagged streams including  
the tags. In my special case, the tag in question is an integer, if that  
helps.

I checked so far:

- TCP Sink/Source uses file descriptor sink, which does not “save”  
tags
- socket PDU, but this only takes the cdr part of the cons

I could imagine that this is a bit tricky as writing tagged streams to  
files is tricky, either. Hence I am asking for suggestions, how to  
implement this.

Best regards

Stephan Ludwig

Robert Bosch GmbH  
Corporate Sector Research & Advance Engineering, Communication  
Technology (CR/AEH4)  
Renningen  
70465 Stuttgart  
GERMANY

> **[Want to know how to live #LikeABosch?](https://www.bosch.com/)**
>
> Moving stories and inspiring interviews. Experience the meaning of "invented for life" by Bosch completely new. Visit our international website.

Tel. +49(711)811-8809  
Fax +49(711)811-1052  
Mobile +49(172)5630639  
removed\_email\_address@domain.invalid

Registered Office: Stuttgart, Registration Court: Amtsgericht Stuttgart,  
HRB 14000;  
Chairman of the Supervisory Board: Franz Fehrenbach; Managing Directors:  
Dr. Volkmar Denner,  
Dr. Stefan Asenkerschbaumer, Dr. Rolf Bulander, Dr. Stefan Hartung, Dr.  
Markus Heyn, Dr. Dirk Hoheisel,  
Christoph Kbel, Uwe Raschke, Dr. Werner Struth, Peter Tyroller

---

<div class="post-metadata">

**Author:** ![Ludwig\_Stephan\_SCR](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e36b37/32.png) [@Ludwig\_Stephan\_SCR](https://www.ruby-forum.com/u/Ludwig_Stephan_SCR)\
**Post date:** [June 26, 2015, 10:12am UTC](https://www.ruby-forum.com/t/transmit-stream-tags-via-socket/242475/2 "2015-06-26T10:12:45Z")

</div>

Hi Stephan,

have a look at the ZeroMQ blocks (ZeroMQ, including the ZeroMQ C++  
wrapper header will need to be present at compilation time);  
The ZeroMQ sinks have the option to pass along tags!  
ZeroMQ is a world of its own; if you want a single point-to-point  
connection, try the REP sink and the REQ source, with an address like  
tcp://:5555 in both.  
If you want a publisher/multi-subscriber thing, have a look at the  
pub/sub combination. There’s examples, typically in  
/usr/share/gnuradio/examples/zeromq

Best regards,  
Marcus

---

<div class="post-metadata">

**Author:** ![Ludwig\_Stephan\_SCR](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e36b37/32.png) [@Ludwig\_Stephan\_SCR](https://www.ruby-forum.com/u/Ludwig_Stephan_SCR)\
**Post date:** [June 26, 2015, 11:14am UTC](https://www.ruby-forum.com/t/transmit-stream-tags-via-socket/242475/3 "2015-06-26T11:14:05Z")

</div>

Hello Marcus,  
hello Kevin,

thank you for your hints. Meanwhile I also recognized pmt::serialize,  
which I found awesome. And Marcus pointing to ZeroMQ was even better. I  
will try both and report back.

Mit freundlichen Gren / Best regards

Stephan Ludwig

Robert Bosch GmbH  
Corporate Sector Research & Advance Engineering, Communication  
Technology (CR/AEH4)  
Renningen  
70465 Stuttgart  
GERMANY

> **[Want to know how to live #LikeABosch?](https://www.bosch.com/)**
>
> Moving stories and inspiring interviews. Experience the meaning of "invented for life" by Bosch completely new. Visit our international website.

Tel. +49(711)811-8809  
Fax +49(711)811-1052  
Mobile +49(172)5630639  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Registered Office: Stuttgart, Registration Court: Amtsgericht Stuttgart,  
HRB 14000;  
Chairman of the Supervisory Board: Franz Fehrenbach; Managing Directors:  
Dr. Volkmar Denner,  
Dr. Stefan Asenkerschbaumer, Dr. Rolf Bulander, Dr. Stefan Hartung, Dr.  
Markus Heyn, Dr. Dirk Hoheisel,  
Christoph Kbel, Uwe Raschke, Dr. Werner Struth, Peter Tyroller

-----Ursprngliche Nachricht-----  
Von: [discuss-gnuradio-bounces+stephan.ludwig2=removed\_email\_address@domain.invalid](mailto:discuss-gnuradio-bounces+stephan.ludwig2=removed_email_address@domain.invalid)  
[[mailto:discuss-gnuradio-bounces+stephan.ludwig2=removed\_email\_address@domain.invalid](mailto:discuss-gnuradio-bounces+stephan.ludwig2=removed_email_address@domain.invalid)]  
Im Auftrag von Marcus M.  
Gesendet: Freitag, 26. Juni 2015 10:11  
An: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Betreff: Re: [Discuss-gnuradio] Transmit stream tags via socket

Hi Stephan,

have a look at the ZeroMQ blocks (ZeroMQ, including the ZeroMQ C++  
wrapper header will need to be present at compilation time); The ZeroMQ  
sinks have the option to pass along tags!  
ZeroMQ is a world of its own; if you want a single point-to-point  
connection, try the REP sink and the REQ source, with an address like  
tcp://:5555 in both.  
If you want a publisher/multi-subscriber thing, have a look at the  
pub/sub combination. There’s examples, typically in  
/usr/share/gnuradio/examples/zeromq

Best regards,  
Marcus

On 06/26/2015 07:20 AM, Ludwig Stephan (CR/AEH4) wrote:

> Best regards  
> Tel. +49(711)811-8809
> 
> * * *
> 
> Discuss-gnuradio mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

* * *

Discuss-gnuradio mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)**

---

<div class="post-metadata">

**Author:** ![Ludwig\_Stephan\_SCR](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e36b37/32.png) [@Ludwig\_Stephan\_SCR](https://www.ruby-forum.com/u/Ludwig_Stephan_SCR)\
**Post date:** [June 26, 2015, 1:48pm UTC](https://www.ruby-forum.com/t/transmit-stream-tags-via-socket/242475/4 "2015-06-26T13:48:54Z")

</div>

Hello all,

as promised my experiences: Using ZeroMQ works really cool and out of  
the box. So good that I dropped the option proposed by Kevin (sorry).

I share some (now somewhat trivial) notes, if somebody else (with  
equally few experience) wants to try:

- On Ubuntu you have to install libzmqpp-dev (and dependencies) and then  
re-cmake and re-build GR, as Marcus pointed out.
- The address field does not resolve domain names
- REQ = Client, REP = Server
- your port number must larger 1024 (\<1024 are root use only ports)
- Due to Ubuntus firewall settings (iptables) incoming connections are  
blocks =\> the IP address of REP(Server) must be the IP in the address  
field.

Thanks to Marcus and Kevin again.

Mit freundlichen Gren / Best regards

Stephan Ludwig

Robert Bosch GmbH  
Corporate Sector Research & Advance Engineering, Communication  
Technology (CR/AEH4)  
Renningen  
70465 Stuttgart  
GERMANY

> **[Want to know how to live #LikeABosch?](https://www.bosch.com/)**
>
> Moving stories and inspiring interviews. Experience the meaning of "invented for life" by Bosch completely new. Visit our international website.

Tel. +49(711)811-8809  
Fax +49(711)811-1052  
Mobile +49(172)5630639  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Registered Office: Stuttgart, Registration Court: Amtsgericht Stuttgart,  
HRB 14000;  
Chairman of the Supervisory Board: Franz Fehrenbach; Managing Directors:  
Dr. Volkmar Denner,  
Dr. Stefan Asenkerschbaumer, Dr. Rolf Bulander, Dr. Stefan Hartung, Dr.  
Markus Heyn, Dr. Dirk Hoheisel,  
Christoph Kbel, Uwe Raschke, Dr. Werner Struth, Peter Tyroller

-----Ursprngliche Nachricht-----  
Von: [discuss-gnuradio-bounces+stephan.ludwig2=removed\_email\_address@domain.invalid](mailto:discuss-gnuradio-bounces+stephan.ludwig2=removed_email_address@domain.invalid)  
[[mailto:discuss-gnuradio-bounces+stephan.ludwig2=removed\_email\_address@domain.invalid](mailto:discuss-gnuradio-bounces+stephan.ludwig2=removed_email_address@domain.invalid)]  
Im Auftrag von Ludwig Stephan (CR/AEH4)  
Gesendet: Freitag, 26. Juni 2015 11:13  
An: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Betreff: Re: [Discuss-gnuradio] Transmit stream tags via socket

Hello Marcus,  
hello Kevin,

thank you for your hints. Meanwhile I also recognized pmt::serialize,  
which I found awesome. And Marcus pointing to ZeroMQ was even better. I  
will try both and report back.

Mit freundlichen Gren / Best regards

Stephan Ludwig

Robert Bosch GmbH  
Corporate Sector Research & Advance Engineering, Communication  
Technology (CR/AEH4) Renningen  
70465 Stuttgart  
GERMANY

> **[Want to know how to live #LikeABosch?](https://www.bosch.com/)**
>
> Moving stories and inspiring interviews. Experience the meaning of "invented for life" by Bosch completely new. Visit our international website.

Tel. +49(711)811-8809  
Fax +49(711)811-1052  
Mobile +49(172)5630639  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Registered Office: Stuttgart, Registration Court: Amtsgericht Stuttgart,  
HRB 14000; Chairman of the Supervisory Board: Franz Fehrenbach; Managing  
Directors: Dr. Volkmar Denner, Dr. Stefan Asenkerschbaumer, Dr. Rolf  
Bulander, Dr. Stefan Hartung, Dr. Markus Heyn, Dr. Dirk Hoheisel,  
Christoph Kbel, Uwe Raschke, Dr. Werner Struth, Peter Tyroller

-----Ursprngliche Nachricht-----  
Von: [discuss-gnuradio-bounces+stephan.ludwig2=removed\_email\_address@domain.invalid](mailto:discuss-gnuradio-bounces+stephan.ludwig2=removed_email_address@domain.invalid)  
[[mailto:discuss-gnuradio-bounces+stephan.ludwig2=removed\_email\_address@domain.invalid](mailto:discuss-gnuradio-bounces+stephan.ludwig2=removed_email_address@domain.invalid)]  
Im Auftrag von Marcus M.  
Gesendet: Freitag, 26. Juni 2015 10:11  
An: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Betreff: Re: [Discuss-gnuradio] Transmit stream tags via socket

Hi Stephan,

have a look at the ZeroMQ blocks (ZeroMQ, including the ZeroMQ C++  
wrapper header will need to be present at compilation time); The ZeroMQ  
sinks have the option to pass along tags!  
ZeroMQ is a world of its own; if you want a single point-to-point  
connection, try the REP sink and the REQ source, with an address like  
tcp://:5555 in both.  
If you want a publisher/multi-subscriber thing, have a look at the  
pub/sub combination. There’s examples, typically in  
/usr/share/gnuradio/examples/zeromq

Best regards,  
Marcus

On 06/26/2015 07:20 AM, Ludwig Stephan (CR/AEH4) wrote:

> Best regards  
> Tel. +49(711)811-8809
> 
> * * *
> 
> Discuss-gnuradio mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

* * *

Discuss-gnuradio mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)**

* * *

Discuss-gnuradio mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)**
