I am implementing a netcat clone and currently need a way to run command-line programs over the network.
My solution so far is to execute a process and use pipes for STDIN and STDOUT, then forward the data back and forth over TCP.
The problem is, I feel like this is a round-about way of doing things. When I run bash, the prompt doesn't show up, and I am unable to use ncurses programs, like Vi.
Is there an easier way to control the input and see the output of a program in C, or are pipes my best bet?
Here a portion of my code (click on it, it's very intuitive):
I am using C with GNU/Linux.