<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-04-25 3:39 GMT-03:00 Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span>:</div>
<div class="gmail_quote">[...]<span style="color:rgb(80,0,80)"> </span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Damn windows returning 0 on read... Can you please test with the following change:<div><br>
<br>
Procedure FillBuffer;<br>
<br>
Var<br>
R : Integer;<br>
<br>
begin<br>
SetLength(FBuffer,ReadBufLen);<br></div>
Repeat<br>
r:=FSocket.Read(FBuffer[1],<u></u>ReadBufLen);<div><br>
If r<0 then<br>
Raise EHTTPServer.Create(<u></u>SErrReadingSocket);<br></div>
if R=0 then<br>
Sleep(10);<br>
Until (R<>0);<br>
if (R<ReadBuflen) then<br>
SetLength(FBuffer,r);<br>
end;</blockquote></div><div><br></div><div><div>After apply this change, now when read returns 0, it freezes the app., because the "sleep(10)" command is infinitely called. :/</div><div><br></div><div>Damn windows!</div>
</div><div>
<br></div>-- <br>Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a>
</div></div>