Hello
Given the requirements below; what input/output method should be used?
A linux process will operate as a proxy between a mounted GPS device and a NTPD (Network Time Protocol daemon). The proxy will receive commands from another linux process and send back information. These commands will be GET_GPS_DEVICE_VERSION, RESET_GPS_DEVICE and KEEP_ALIVE.
So the proxy process will need to listen/communicate between 3 things; the GPS, the NTPD and the command process. The order of operations will be; read GPS serial stream (and store message), read command process serial stream, perform command (if command != KEEP_ALIVE) and propagate GPS serial message to NTPD.
Given these requirements and considering speed and safest implementation which should be used?
- Simple serial stream - open("dev/port", O_RDWR | O_NOCTTY | O_NDELAY);
- Use a pipe?
- Use a Message Queue?
- Use sockets? Note all processes and components are on the same network and OS.
- Use shared memory (seems like overkill?)