[fpc-pascal] fphttpclient and timeout
Philippe
philippe at quarta.com.br
Fri Oct 24 14:58:35 CEST 2014
Em 24.10.2014 09:54, silvioprog escreveu:
> On Fri, Oct 24, 2014
at 8:41 AM, Michael Van Canneyt <michael at freepascal.org>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.
>
>
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
[1]
>
> [2] -
https://github.com/silvioprog/tcpipcomp/blob/master/src/tcpipclient.pas#L130
[2]
> --
> Silvio Clécio
> My public projects - github.com/silvioprog
[3]
> Thanks ... may be a bit complicated for me now ... I keep it for
later!
_______________________________________________
fpc-pascal
maillist -
fpc-pascal at lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[4]
>
Links:
------
[1]
https://github.com/silvioprog/tcpipcomp/blob/master/src/tcpipbase.pas#L105
[2]
https://github.com/silvioprog/tcpipcomp/blob/master/src/tcpipclient.pas#L130
[3]
http://github.com/silvioprog
[4]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20141024/f43b179c/attachment.html>
More information about the fpc-pascal
mailing list