Welcome Guest Search | Active Topics | Sign In | Register

Thread problems - on some systems Options
serializer
Posted: Monday, March 13, 2017 9:28:39 AM
Rank: Advanced Member
Groups: Member

Joined: 5/9/2016
Posts: 84
I am running this piece of code:

Code: C#
public static string GetUserAgent()
		{
			var userAgent = "";
            try
            {
                var thRunner = new ThreadRunner();
                var webView = thRunner.CreateWebView();
                thRunner.Send(() =>
                {
                    webView.LoadUrlAndWait("about:blank");
                    userAgent = webView.EvalScript("navigator.userAgent").ToString();
                });
                thRunner.Stop();
            }
            catch (Exception ex)
            {
                
                // ignore
            }

			return userAgent;
		}


The idea is to extract the userAgent. This works on 99% of computers. But for example, on some Windows 7 (Spanish) version it does not always work. We have not found reason for this. The exception we get is:

Code: C#
EO.Internal.jq+e: Child process exited unexpectedly. 
at EO.Base.ThreadRunnerBase.f.a(Int32 A_0, Boolean& A_1)
at EO.Base.ThreadRunnerBase.Send(ActionWithResult action, Int32 timeoutInMS, Boolean& done)
at EO.WebBrowser.ThreadRunner.a(Int32 A_0, Int32 A_1, Boolean A_2, BrowserOptions A_3)
at WebAutomation.WebAuto.AENHFKOMDOELCJJKFJCDPBLMPIFDPLMEIOHL(Object )
at WebAutomation.WebAuto.GetUserAgent() in c:\sourcefiles\VisualCron - Addons\WebAuto\WebAutomation\WebAuto.cs:line 235


After adding the Exception handling we got this error (similar, from other place):



It occurs in this code:

Code: Visual Basic.NET
AddHandler pb.HandleCreated, Sub(sender, args)
                                                                              wv.Create(pb.Handle)
                                                                              pb.Tag = wv
                                                                          End Sub


I am suspecting that the computers in question are slower than other which may result in a timeout but how can this be handled?
eo_support
Posted: Monday, March 13, 2017 2:43:17 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

Your code looks fine. This should not be a timeout issue. This usually occurs when the child process has crashed for whatever reason. A few things you can check:

1. Check your event viewer and see if you can see any error there;
2. Check if you have any AntiVirus program on the computer and disable it temporarily;
3. Check if the latest build from our download page resolves the issue;

If the problem continues, we may need to take a look of the computer (through TeamViewer) in order to find out the root cause.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.