# Using Boost ASIO to create a TCP Client

**URL:** <https://discourse.libcinder.org/t/using-boost-asio-to-create-a-tcp-client/237>\
**Category:** Using Cinder\
**Created:** [August 23, 2016, 8:32am UTC](https://discourse.libcinder.org/t/using-boost-asio-to-create-a-tcp-client/237 "2016-08-23T08:32:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dazzid](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/dazzid/32/158_2.png) [@Dazzid](https://discourse.libcinder.org/u/Dazzid)\
**Post date:** [August 23, 2016, 8:32am UTC](https://discourse.libcinder.org/t/using-boost-asio-to-create-a-tcp-client/237/1 "2016-08-23T08:32:36Z")

</div>

Hi All,  
I have to read data coming from a tcp server that streams EEG sensors data on a json format wich contains a matrix of 8x4 sensors. I just want to ask how to start such a reader on Cinder. I don’t have experience with tcp ports and communication, all life using udp. Is there any example?  
The simulator of the EEG data is here (windows)

> **[Dropbox - Link not found](https://www.dropbox.com/sh/ufcqhb7atbk6zom/AAA_8l59FykLEqFIasQMODV4a?dl=0)**
>
> Dropbox is a free service that lets you bring your photos, docs, and videos anywhere and share them easily. Never email yourself a file again!

I run the server.exe which connect to the port 5000. With the command {“COMMAND”:“start”} it starts streaming.  
Thanks for the advise  
David

---

<div class="post-metadata">

**Author:** ![balachandran\_c](https://avatars.discourse-cdn.com/v4/letter/b/f17d59/32.png) [@balachandran\_c](https://discourse.libcinder.org/u/balachandran_c)\
**Post date:** [August 23, 2016, 12:33pm UTC](https://discourse.libcinder.org/t/using-boost-asio-to-create-a-tcp-client/237/2 "2016-08-23T12:33:42Z")

</div>

Hi David,

Have you tried the [TcpClient](https://github.com/BanTheRewind/Cinder-Asio/tree/master/samples/TcpClient) example in [Cinder-Asio](https://github.com/BanTheRewind/Cinder-Asio)?

Bala.

---

<div class="post-metadata">

**Author:** ![Dazzid](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/dazzid/32/158_2.png) [@Dazzid](https://discourse.libcinder.org/u/Dazzid)\
**Post date:** [August 23, 2016, 12:56pm UTC](https://discourse.libcinder.org/t/using-boost-asio-to-create-a-tcp-client/237/3 "2016-08-23T12:56:45Z")

</div>

Yes, but I don’t really have experience with tcp/ip, the client example runs if the server of the EEG app is not running, both have to be on port 5000, but this is making the example to crash.

---

<div class="post-metadata">

**Author:** ![balachandran\_c](https://avatars.discourse-cdn.com/v4/letter/b/f17d59/32.png) [@balachandran\_c](https://discourse.libcinder.org/u/balachandran_c)\
**Post date:** [August 23, 2016, 1:16pm UTC](https://discourse.libcinder.org/t/using-boost-asio-to-create-a-tcp-client/237/4 "2016-08-23T13:16:50Z")

</div>

Can you explain the bit about “both have to be on port 5000” ? Why should the client care about the local port?
