HACKER Q&A
📣 SemanticDevice

C debug console server recommendaiton


I am looking for a recommendation (library or technology) for a server that can run inside my program to which I can send commands from a client program running on the same machine. The approach must run on Linux and Windows and be written in C (tough I'm sure I can get C++ to work).

For example, my program is running, and I would like to change its state without going through its UI. I would like to open a telnet-type shell (or any other CLI) which connects to my program. I then would like to enter commands and see responses back from my program.

I can throw a Lua interpreter into my program and feed it commands, what I don't know how to do is let some other process attach to mine and communicate. I'm familiar with threads and know how to offload the interpreter and command handling. I know sockets are a thing, but I haven't a clew of how to use them to communicate between processes without writing both ends custom.

Security is not an issue, since this is a debug-only feature.

Thanks!


  👤 SemanticDevice Accepted Answer ✓
OP here... I just ran across ZeroMQ [0], which looks like it makes IPC simple and has bindings to many languages. The disadvantage is that I will still have to roll my own client, but it looks like I throw something together on the client side using Python.

That said, I'm still looking for recommendations and discussion.

0: https://zeromq.org


👤 qppo
You can always read from stdin