<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Oct 24, 2014 at 8:41 AM, Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span> wrote:<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">
On Fri, 24 Oct 2014, Philippe wrote:<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">
Using basically HTTPClient.Get, I did not find time out configuration with fphttpclient. Did I missed it?<br>
</blockquote>
<br>
it does not exist yet.<br>
<br>
<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">
<br>
If not, is there a way to implement it ? Using thread?<br>
</blockquote>
<br>
that would be one way.<br>
<br>
<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">
<br>
If not, is there a similar library/unit with configurable timeout?<br>
</blockquote>
<br>
synapse probably has it.<br>
<br>
Michael.</blockquote></div><div><br></div><div><br></div><div>You could implement the timeout directly in the internal FSocket in TFPHttpClient(*). I implemented that using "GetTick"[1] and "TTimeVal"[2]:</div><div><br></div><div>Just suggestions! =)</div><div><br></div><div>(*) E.g:</div><div><br></div><div>TFPCustomHTTPSocket = class(TInetSocket) // implementing the timout</div><div>..</div><div><div> TFPCustomHTTPClient = Class(TComponent)</div><div> private</div><div>...</div><div> FSocket : TFPCustomHTTPSocket; // using TFPCustomHTTPSocket instead of TInetSocket directly because TFPCustomHTTPSocket implements the timeout</div></div><div><br></div><div>[1] - <a href="https://github.com/silvioprog/tcpipcomp/blob/master/src/tcpipbase.pas#L105" target="_blank">https://github.com/silvioprog/tcpipcomp/blob/master/src/tcpipbase.pas#L105</a><br></div><div><br></div><div>[2] - <a href="https://github.com/silvioprog/tcpipcomp/blob/master/src/tcpipclient.pas#L130" target="_blank">https://github.com/silvioprog/tcpipcomp/blob/master/src/tcpipclient.pas#L130</a><br></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>