luk1990 wrote:
is there a beginner tutorial how to define messages and how to send them?
id prefer a c++ solution.
There's lots of tcp socket examples out there for C++, often they implement a basic chat server, if you can understand how they work then you can make your own. In terms of the message it's just a byte stream so you can define what you want.
Depending on the application you may also want to look at the various message brokers/queues (mqtt, rabbitmq etc). These often come with a library to make your code easier and can handle communication between multiple processes (good if your application might grow beyond two pis talking.