Do I redirect stdout to opened socket?
- From: thisrule@xxxxxxxxx
- Date: 28 Dec 2005 23:07:16 -0800
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.
.
- Follow-Ups:
- Re: Do I redirect stdout to opened socket?
- From: Andrei Voropaev
- Re: Do I redirect stdout to opened socket?
- Prev by Date: Re: glibc 2.2 vs 2.3 issue back again
- Next by Date: Is the libguile plus Scheme best partner for a program with script built-in?
- Previous by thread: glibc 2.2 vs 2.3 issue back again
- Next by thread: Re: Do I redirect stdout to opened socket?
- Index(es):
Relevant Pages
|