I have 2 computers. One (computer 2) is getting files (.json) from 2 different processes, and then it passes this files (through ethernet cable) to the other computer (computer 1) (like in the attached image). This happens constantly not just one's.
To do this file transfers, my idea is the following:
- Create a server/client sockets in c to comunicate both computers.
- Tar the files (an amount say 4 files) in computer 2.
- Recive the files in computer 1.
One way at first I wanted to do this, was with Netcat and tar, in bash. But the I read that it was not a good Ideas, because bash doesn't work well with file transfers. So I decided to do it in C (it has to be C, or C++, not python, but I am better at C so C is the option). So now I am doing it with this sample code:
Send and Receive a file in socket programming in Linux with C/C++ (GCC/G++)
but I cant figure out the part of tar and sending Tar, and if this code would help for this.
Other way I wa thinking to do it was with zeromq, but I havent use this before, so I dont know if it is worth the extra studding.
Thanks a lot in advance for your answers.