On Fri, Oct 24, 2014 at 8:41 AM, Michael Van Canneyt <
Show quoted text 23 lines
wrote:
On Fri, 24 Oct 2014, Philippe wrote:
>
> Using basically HTTPClient.Get, I did not find time out configuration
> with fphttpclient. Did I missed it?
>
it does not exist yet.
> If not, is there a way to implement it ? Using thread?
>
that would be one way.
> If not, is there a similar library/unit with configurable timeout?
>
synapse probably has it.
Michael.
You could implement the timeout directly in the internal FSocket in TFPHttpClient(*). I implemented that using "GetTick"[1] and "TTimeVal"[2]:
Just suggestions! =)
(*) E.g:
TFPCustomHTTPSocket = class(TInetSocket) // implementing the timout ..
TFPCustomHTTPClient = Class(TComponent)
private
...
FSocket : TFPCustomHTTPSocket; // using TFPCustomHTTPSocket instead of
TInetSocket directly because TFPCustomHTTPSocket implements the timeout
[1] -
https://github.com/silvioprog/tcpipcomp/blob/master/src/tcpipbase.pas#L105
[2] -
https://github.com/silvioprog/tcpipcomp/blob/master/src/tcpipclient.pas#L130
Silvio Clécio
My public projects - github.com/silvioprog