Long lasting connection between Yún and PC

I need to connect the Yun to a PC and transmit sensor data at least every 500 ms.
I had the intention to use sockets; opening them when initiating the connection and leaving them open until one of the parties disconnects.

However, I have played with YunServer and YunClient and read the documentation and this doesn't seem to be possible.

What should be the approach here? Should I communicate sensor data to the Linino (via the bridge?), and then use Python to manage the connection to the PC and sockets lifespan?

I would be very grateful to hear about the possible alternatives.

Thank you very much,
Manuel

I've been thinking about this as I'm getting ready to build a robot around the Yún. My plan is to write some code in Python which handles the sockets and passes the data back and forth to stdin and stdout. Then I will launch this Python process from the Arduino side using the runAsynchronously() method from the Process class. Telemetry data will be sent from the Arduino side to the Python process (and ultimately the remote control point) with the write() method, and control commands will be read with the read() method. You can periodically check to make sure the Python process is still running with the running() method and respawn as necessary.

I will let you know how it goes once I start coding. :slight_smile:

The perfect case to use Node.js.

Node.js is a platform built on Chrome's JavaScript runtime V8 for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

http://linino.org/doku.php?id=wiki:nodejs

instead of setup server at Yun, we could use client to update data at External Websocket Server.

http://forum.arduino.cc/index.php?topic=217316.msg1590152#msg1590152