I would like to know what is the easiest way (amongst various alternatives) to exchange objects (or some data) between two linux-based systems.

It appears socket-programming could be a choice, but I have not done it earlier so I am not sure if it is the best way. Could anyone point me to a reference please?

TIA,
Sviiya