Page 1 of 1

Internet connetion is lost

PostPosted: Mon Jul 05, 2021 10:04 am
by ValentinNikin
How I can catch 2 situations:
1) Rendering process is working, but in the some moment internet connection is lost.
2) Internet connection is absent, when application starting.

I overrided OnRenderProcessTerminated method for RequestHandler but nothing events. Cef.Initialize returned true, Browser Instance successfully initialized

Re: Internet connetion is lost

PostPosted: Mon Jul 05, 2021 1:51 pm
by ndesktop
Renderer does not crash on network lost.
You can use OnLoadError for requests in progress and look for errors such as ERR_CONNECTION_RESET.
But I think what you want is - with or without a pending request - is to have a callback for network state itself, and this is related to an adapter state, not request.
There is no CefNetworkManager|State|Whatever class exposed by CEF that I am aware of. That would be a good improvement, I suppose.
(Unless there is a way and I don't know about it).

Re: Internet connetion is lost

PostPosted: Mon Jul 05, 2021 3:52 pm
by amaitland

Re: Internet connetion is lost

PostPosted: Mon Jul 05, 2021 4:25 pm
by magreenblatt
You can also use JavaScript online/offline events https://developer.mozilla.org/en-US/doc ... ine_events