Overview
Features
Download
Documentation
Community
Add-Ons & Services

turning off buffering with pipeinputstream

Please post support and help requests here.

turning off buffering with pipeinputstream

Postby ramneekhanda » 21 Nov 2012, 20:05

hi folks,
i am using pipeinputstream to get the output from my subprocess.. i am unable to figure out how to make it unbuffered and i have tried various options but it doesnt seem to work. here is what i have tried so far:

take 1:
Code: Select all
    Poco::Pipe outPipe;
    ProcessHandle ph = Poco::Process::launch(makeReplacement, params, 0, &outPipe, &outPipe);
    Poco::PipeInputStream istr(outPipe);
    std::string line;
    while (std::getline( istr, line )) {
        proj.projectStream << line;
    }

take 2:
Code: Select all
    Poco::Pipe outPipe;
    ProcessHandle ph = Poco::Process::launch(makeReplacement, params, 0, &outPipe, &outPipe);
    Poco::PipeInputStream istr(outPipe);
    istr.rdbuf()->pubsetbuf(0, 0);
    Poco::StreamCopier::copyStreamUnbuffered(istr, proj.projectStream);
    int retcode = ph.wait();


any help is appreciated!
ramneekhanda
 
Posts: 2
Joined: 21 Nov 2012, 19:59

Re: turning off buffering with pipeinputstream

Postby alex » 22 Nov 2012, 20:34

Apparently, some standard library implementations are not conforming. Since POCO PipeStreams are buffered, the only way around it would be to create your own unbuffered hierarchy.
alex
 
Posts: 1086
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: turning off buffering with pipeinputstream

Postby ramneekhanda » 22 Nov 2012, 21:42

alex wrote:Apparently, some standard library implementations are not conforming. Since POCO PipeStreams are buffered, the only way around it would be to create your own unbuffered hierarchy.


Hmm.. thought so.. Thanks :).
ramneekhanda
 
Posts: 2
Joined: 21 Nov 2012, 19:59


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron