Networking Forums

Networking Forums > Computer Networking > Linux Networking > How do I redirect server's standard output to socket?

Reply
Thread Tools Display Modes

How do I redirect server's standard output to socket?

 
 
thisrule@gmail.com
Guest
Posts: n/a

 
      12-29-2005, 06:30 AM
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[X-Posting]W2k3 Server, NLB, App Center 2000 FrontPage 2002 Server Extensions - Redirect not working Rob Meade Windows Networking 0 09-04-2007 07:33 PM
Could an ICMP Redirect have disconnected my server? ljb Linux Networking 7 09-01-2007 11:56 PM
How to redirect crashed server UNC to temp server? Kerberos issue? pcgnow Windows Networking 1 03-23-2007 12:47 AM
Wireless redirect to local web server? speed153@hotmail.com Linux Networking 0 05-17-2005 05:43 PM
Sendmail redirect to another server Taiffu Linux Networking 4 03-10-2005 09:36 PM



1 2 3 4 5 6 7 8 9 10 11