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

2018-02-24 Thread Luca Olivetti
El 24/02/18 a les 15:38, Dimitrios Chr. Ioannidis via fpc-pascal ha escrit: The only reliable way to enforce a connect timeout is to try to connect in non-blocking mode. Something like this ( sorry again in ssockects.pp ) for windows only, very draft code proof of concept which it works ( w

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

2018-02-24 Thread Dimitrios Chr. Ioannidis via fpc-pascal
Hi, Στις 24/2/2018 2:00 μμ, ο Luca Olivetti έγραψε: < snip > OK. I got it. Point taken. I don't think you did No I really did ;). The only reliable way to enforce a connect timeout is to try to connect in non-blocking mode. Something like this ( sorry again in ssockects.pp ) for win

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

2018-02-24 Thread Luca Olivetti
El 24/02/18 a les 13:00, Luca Olivetti ha escrit: Sure, with some combination of kernel/winsock version it could possibly work (with mine it doesn't), but then it would be just enough to set the IoTimeout in the TFpHttpClient (which I'm already doing), no need to modify ssockets.pp. Correcti

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

2018-02-24 Thread Luca Olivetti
El 24/02/18 a les 10:19, Dimitrios Chr. Ioannidis via fpc-pascal ha escrit: Hi, On 2018-02-24 03:42, Luca Olivetti wrote: El 23/02/18 a les 22:57, Dimitrios Chr. Ioannidis via fpc-pascal ha escrit: Hi Στις 23/2/2018 11:14 μμ, ο Luca Olivetti έγραψε: The TFPCustomHTTPClient calls TInetSocket

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

2018-02-24 Thread Dimitrios Chr. Ioannidis via fpc-pascal
Hi, On 2018-02-24 03:42, Luca Olivetti wrote: El 23/02/18 a les 22:57, Dimitrios Chr. Ioannidis via fpc-pascal ha escrit: Hi Στις 23/2/2018 11:14 μμ, ο Luca Olivetti έγραψε: The TFPCustomHTTPClient calls TInetSocket.Create constructor which it calls the inherited constructor from TSocketStr

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

2018-02-23 Thread Luca Olivetti
El 23/02/18 a les 22:57, Dimitrios Chr. Ioannidis via fpc-pascal ha escrit: Hi Στις 23/2/2018 11:14 μμ, ο Luca Olivetti έγραψε: yes, it does (in procedure TFPCustomHTTPClient.ConnectToServer)   FSocket:=TInetSocket.Create(AHost,APort,G);   try     if FIOTimeout<>0 then   FSocket.IOTimeou

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

2018-02-23 Thread Dimitrios Chr. Ioannidis via fpc-pascal
Hi Στις 23/2/2018 11:14 μμ, ο Luca Olivetti έγραψε: 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);

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

2018-02-23 Thread Luca Olivetti
El 23/02/18 a les 19:34, Dimitrios Chr. Ioannidis via fpc-pascal ha escrit: Hi, Στις 23/2/2018 8:24 μμ, ο Luca Olivetti έγραψε: El 23/02/18 a les 18:51, Dimitrios Chr. Ioannidis via fpc-pascal ha escrit:    copy the ssockets.pp from \packages\fcl-net\src dir to your project dir and add th

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

2018-02-23 Thread Dimitrios Chr. Ioannidis via fpc-pascal
Hi, Στις 23/2/2018 8:24 μμ, ο Luca Olivetti έγραψε: El 23/02/18 a les 18:51, Dimitrios Chr. Ioannidis via fpc-pascal ha escrit:    copy the ssockets.pp from \packages\fcl-net\src dir to your project dir and add the following line SetIOTimeout(FIOTimeout); to Procedure TInetSocket.Connec

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

2018-02-23 Thread Luca Olivetti
El 23/02/18 a les 18:51, Dimitrios Chr. Ioannidis via fpc-pascal ha escrit:   copy the ssockets.pp from \packages\fcl-net\src dir to your project dir and add the following line SetIOTimeout(FIOTimeout); to Procedure TInetSocket.Connect; like this fphttpclient already does that before ca

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

2018-02-23 Thread Dimitrios Chr. Ioannidis via fpc-pascal
Hi, Στις 23/2/2018 5:17 μμ, ο Michael Van Canneyt έγραψε: On Fri, 23 Feb 2018, Luca Olivetti wrote: 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 overri

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

2018-02-23 Thread Michael Van Canneyt
On Fri, 23 Feb 2018, Luca Olivetti wrote: 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 con

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

2018-02-23 Thread Luca Olivetti
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