Re: Do I redirect stdout to opened socket?
- From: Andrei Voropaev <avorop@xxxxxxx>
- Date: Thu, 29 Dec 2005 09:24:29 +0000 (UTC)
On 2005-12-29, thisrule@xxxxxxxxx <thisrule@xxxxxxxxx> wrote:
[...]
> Then, write( 1, "message\n", 8 ) works good.
> The string, "message" displayed in the client program.
> But printf( "message\n" ) does not work.
It does work. But printf and friends are using buffered output. In
other words they store whatever they get in the buffer and send it only
when the buffer is full (kind of). There are different ways to control the
buffering behaviour on streams. In the simplest case you can call
fflush(stdout) to force writing of the data immidiately. Alternatevely
you can use setvbuf function to make your stdout stream unbuffered.
Actually this applies to stderr and any other stream (type FILE*).
--
Minds, like parachutes, function best when open
.
- References:
- Do I redirect stdout to opened socket?
- From: thisrule
- Do I redirect stdout to opened socket?
- Prev by Date: Is the libguile plus Scheme best partner for a program with script built-in?
- Next by Date: Re: program hangs after calling exit
- Previous by thread: Do I redirect stdout to opened socket?
- Next by thread: Is the libguile plus Scheme best partner for a program with script built-in?
- Index(es):
Relevant Pages
|