[fpc-pascal] fphttclient, no way to specify a connect timeout

Luca Olivetti luca at ventoso.org
Sat Feb 24 02:42:15 CET 2018


El 23/02/18 a les 22:57, Dimitrios Chr. Ioannidis via fpc-pascal ha escrit:
> Hi
> 
> Στις 23/2/2018 11:14 μμ, ο Luca Olivetti έγραψε:
> 
> <snip>
>> yes, it does (in procedure TFPCustomHTTPClient.ConnectToServer)
>>
>>   FSocket:=TInetSocket.Create(AHost,APort,G);
>>   try
>>     if FIOTimeout<>0 then
>>       FSocket.IOTimeout:=FIOTimeout; <-----
>>     FSocket.Connect;
>>   except
>>     FreeAndNil(FSocket);
>>     Raise;
>>   end;
> 
> please follow the call stack.
> 
> The TFPCustomHTTPClient calls TInetSocket.Create constructor which it 
> calls the inherited constructor from TSocketStream.

Which, since TFPHttpClient assigns a socket handler in G, it won't call 
connect.
So the timeout set above is really done before the connect call.

Bye
-- 
Luca



More information about the fpc-pascal mailing list