I have been trying to implement a full-duplex cli to a daemon I am working on. So far I have been able to either send or receive from my IPC thread but not both. I think that by using something like select() or poll() I should be able to implement both sending and receiving from the message queue in a single thread.
Am I going about this all wrong and should just go the two thread route? It seems like that would be very clunky to require four threads just to handle sending and receiving messages between the daemon and cli application.
Anyone is more than welcome to visit my project and give me hints/tips at improving it. This is the CLI IPC/API I am trying to write.
Your guidance would be much appreciated.