Page 1 of 1

Timeout or abort page loading

Posted: Thu Dec 23, 2021 3:25 pm
by dilfich
"Timeout or abort page loading"
How to do it correctly? For example, I wait 10 seconds, this is if through a proxy and it is slow, I do something like about:blank, I change the proxy and open it again, but sometimes nothing happens. More precisely, the link opens in 30-60 seconds, with an error or successfully.
""Stop Load" before reloading does not help.
How to finally and correctly abort the loadUrl procedure? :?:

Re: Timeout or abort page loading

Posted: Thu Dec 23, 2021 5:03 pm
by salvadordf
Stop is asynchronous and it may take a little time.

There is another method called TCefRequestContextRef.CloseAllConnections but I've never used it and it's only recommended for special cases. These are the code comments for that method :

Code: Select all

  ///
  // Clears all active and idle connections that Chromium currently has. This is
  // only recommended if you have released all other CEF objects but don't yet
  // want to call cef_shutdown(). If |callback| is non-NULL it will be executed
  // on the UI thread after completion.
  ///
However, if you want to be sure then destroy that browser and create a new one with the new proxy settings to open the URL again.