I made two process. One is use for a socket server in remote host, the
other is client.
Socket server includes a big library and will be run in the background,
and client program has GUI with Qt library.
I want server standard output to redirect to client program.
To do it I tried to use dup2() function, following
dup2( socket_descriptor, 1 ); // standard out to socket
dup2( sokcet_descriptor, 2 ); // standard err to socket
Then, write( 1, "message\n", 8 ) works good.
The string, "message" displayed in the client program.
But printf( "message\n" ) does not work.
How do I redirect server's standard output to socket?
Please let me know.
|