luk1990
Posts: 2
Joined: Sun Nov 08, 2015 7:23 pm

ethernet application

Thu Apr 06, 2017 6:41 pm

hello

id like to write an application for linux, where the same application running on 2 raspberry pi's is communicating via ethernet (lan).
the opponents ip address is manually typed in.

is there a beginner tutorial how to define messages and how to send them?
id prefer a c++ solution.

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: ethernet application

Thu Apr 06, 2017 11:25 pm

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: ethernet application

Fri Apr 07, 2017 8:19 am

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.

Return to “General discussion”