I have two C/C++ socket programs, say server
and client
, and both communicate to each other through read
and write
. The entire flow works fine (i.e., communication, read, write) when I run the two programs on two separate terminals in localhost. To avoid manually starting the client
program, I use system(exec_cmd_to_run_client_program)
in my server program. However, doing so doesn't give me the correct result as that of two separate terminals. I do see server
and client
running in the job monitor, but the communication in between seems never happens. What could be the problem?
Also I tried using ssh library libssh
in the server
program to open a new ssh session and send execution command to run the client
program. Again I see the same result as system call. Both programs showed up in the job monitor but communication never happens. Did I miss something?