<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jan 26, 2017 at 8:20 PM, fredvs <span dir="ltr"><<a href="mailto:fiens@hotmail.com" target="_blank">fiens@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello.<br>
<br>
Some news from the front:<br>
<br>
var<br>
BufferURL : array of float;<br>
<br>
.....<br>
<br>
PipeBufferSize := $4000 ;<br>
<br>
CreatePipeHandles(InHandle, OutHandle, PipeBufferSize);<br>
<br>
InPipe := TInputPipeStream.Create(InHand<wbr>le);<br>
OutPipe := TOutputPipeStream.Create(OutHa<wbr>ndle);<br>
httpget := TThreadHttpGetter.Create(opus_<wbr>url,OutPipe);<br>
<br>
setlength(BufferURL, PipeBufferSize);<br>
<br>
// This to have the buffer as parameter ???<br>
InPipe.Read(BufferURL,PipeBuff<wbr>erSize);<br>
<br>
op_test_memory(BufferURL,PipeB<wbr>ufferSize, Err);<br>
<br>
=> Gives as error: -133 =><br>
A required header packet was not properly formatted, contained illegal<br>
values, or was missing altogether.<br>
<br>
So it seems that the buffer was accepted, only miss the header ?<br>
<br>
Difficult to explore when there is no documentation how to do nor examples.<br></blockquote><div><br></div><div>I had never tried pipes before, but it seems FPC has a unit to handle that: `iostream`, so today I played a very simple test:</div><div><br></div><div><div><font face="monospace, monospace" size="1">program project1;</font></div><div><font face="monospace, monospace" size="1">uses sysutils, iostream;</font></div><div><font face="monospace, monospace" size="1">const buf_sz = 1024;</font></div><div><font face="monospace, monospace" size="1">var</font></div><div><font face="monospace, monospace" size="1"> buf: tbytes;</font></div><div><font face="monospace, monospace" size="1"> sz: longint;</font></div><div><font face="monospace, monospace" size="1"> stdin: tiostream;</font></div><div><font face="monospace, monospace" size="1">begin</font></div><div><font face="monospace, monospace" size="1"> stdin := tiostream.create(iosinput);</font></div><div><font face="monospace, monospace" size="1"> try</font></div><div><font face="monospace, monospace" size="1"> setlength(buf, buf_sz);</font></div><div><span style="font-family:monospace,monospace;font-size:x-small"> // it is just a test, so I limited it to 1024 bytes, please read the entire content by yourself! :-)</span><font face="monospace, monospace" size="1"><br></font></div><div><font face="monospace, monospace" size="1"> sz := stdin.read(buf[0], buf_sz);</font></div><div><font face="monospace, monospace" size="1"> if sz < buf_sz then</font></div><div><font face="monospace, monospace" size="1"> setlength(buf, sz);</font></div><div><font face="monospace, monospace" size="1"> writeln(tencoding.utf8.<wbr>getstring(buf));</font></div><div><font face="monospace, monospace" size="1"> finally</font></div><div><font face="monospace, monospace" size="1"> stdin.free;</font></div><div><font face="monospace, monospace" size="1"> end;</font></div><div><font face="monospace, monospace" size="1">end.</font></div></div><div><br></div><div>in my terminal:</div><div><br></div><div><div><font face="monospace, monospace" size="1">$ echo "Yes" | ./project1 </font></div><div><font face="monospace, monospace" size="1">Yes</font></div></div><div><br></div><div>However, I don't know if you are searching exactly that, anyway you can check the <span style="font-family:monospace,monospace;font-size:x-small">iosinput</span> sources. :-)</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Any idea is highly welcome.<br>
<br>
Fe;D<br>
<br>
-----<br>
Many thanks ;-)</blockquote></div><div><br></div>-- <br><div class="m_5939299837655672583gmail_signature"><div dir="ltr"><div>Silvio Clécio</div></div></div>
</div></div>