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

Luca Olivetti luca at ventoso.org
Fri Feb 23 09:07:58 CET 2018


Hello,

the TFpHttpClient has an IoTimeout property, which in turn sets the 
IOTimeout of its FSocket (TInetSocket), however there's no way to set a 
connection timeout.
I see that even overriding the SocketHandler wouldn't change that, since 
it's connect is only called *after* the fpconnect call succeeds.
Also, I see no way to interrupt a pending connect from another thread.

My problem is that I'm using it in a thread, and, when I terminate the 
application, in case the host is not responding/not available, I have to 
wait the roughly 30 seconds that it takes for the connect to timeout.

I had the same problem with synapse, but there it has been solved 
several years ago by introducing a connection timeout (besides, I can 
abort a socket operation from another thread, though it only works under 
windows).

Bye
-- 
Luca



More information about the fpc-pascal mailing list