Internet connetion is lost

Having problems with building or using the CefSharp .NET binding? Ask your CEF-related questions here. Please ask general usage questions on StackOverflow.

Moderator: amaitland

Internet connetion is lost

Postby ValentinNikin » Mon Jul 05, 2021 10:04 am

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
ValentinNikin
Techie
 
Posts: 34
Joined: Fri Jun 18, 2021 1:37 am

Re: Internet connetion is lost

Postby ndesktop » Mon Jul 05, 2021 1:51 pm

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).
ndesktop
Master
 
Posts: 750
Joined: Thu Dec 03, 2015 10:10 am

Re: Internet connetion is lost

Postby amaitland » Mon Jul 05, 2021 3:52 pm

Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: Internet connetion is lost

Postby magreenblatt » Mon Jul 05, 2021 4:25 pm

You can also use JavaScript online/offline events https://developer.mozilla.org/en-US/doc ... ine_events
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to CefSharp Forum

Who is online

Users browsing this forum: No registered users and 18 guests