-1

Ok so i am currently working on a prototype that is evaluating multiple embedded browsers that will be hosted in a WPF application. I have currently tried Awesonium, CEFSharp, and the native WebBrowser control for WPF. I am also currently using Signalr for communication purposes between the server, web page, and WPF application. During my testing i noticed that Awesonium and CEFSharp will send a message through signalr to the Hub rather quickly(sub second for sure).

When i run the native WPF WebBrowser control there is at least a 3 to 4 second lag before the message reaches the Hub. I am currently using windows 7 and i have IE 11 installed.

My co-worker is using windows 8 and does not have the lag when he runs the application. We have set the meta tag:

<meta http-equiv="X-UA-Compatible" content="IE=Edge" />

We have also tried the Registry hack provided by: http://weblog.west-wind.com/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Version

I have the client set to use long-polling transport for consistency. And the same page is being loaded for all browsers.

here is a snippet of the javascript:

   var chat = $.connection.testHub;
   $.connection.hub.start({ transport: 'longPolling' }).done(function () {
       alert("Connected, transport = " + $.connection.hub.transport.name);
        $('#AweMessage').click(function () {
            alert("clicked");
            chat.server.send('awesonium').done(function () {alert('done');});
        });
        $('#NativeMessage').click(function () {
            alert("clicked");
            chat.server.send('native').done(function () { alert('done'); });
        });
        $('#CEFmessage').click(function () {
            alert("clicked");
            chat.server.send('cef').done(function () { alert('done'); });
        });
    });

I am at a loss here. If anyone has any ideas I'm open to anything. Thanks!

kmacdonald
  • 3,381
  • 2
  • 18
  • 22

2 Answers2

0

You can debug the hub code using IE debugger.

http://blogs.perl.org/users/mark_leighton_fisher/2011/09/debugging-javascript-in-a-webbrowser-control-from-vs2010.html

Find out exactly what takes that much time. You ca step through the code and find out what line takes so much time - it might not even be the actual sending, but something other.

Secondly, you might be able to use ApiMonitor once you track down which call is blocking - and see what is going on.

Oher than that:

  • try different transport systems
  • see if it happens with other user on same machine
Erti-Chris Eelmaa
  • 25,338
  • 6
  • 61
  • 78
0

This actually had nothing to do with my code.

Using fiddler i was able to see that Visual Studio had its own signalr connection to each of the web pages that I was debugging. Specifically long polling to a url that contained "arterySignaLR" after a quick search on stackoverflow i found this post:

.net localhost website consistently making get arterySignalR/poll?transport=longPolling&connectionToken= calls

once i turned off the BrowserLink, my connections were freed up and my web application was no longer slow.

I was eventually able to reproduce this on my co-worker's Windows 8 machine, although he did not experience it as quickly because, Windows 8 will use WebSockets as its primary transportation mode, and to my knowledge there are no limitations for concurrent websocket connections. On the other hand, my windows 7 PC was using long polling for everything and chewing up my connection limit.

Community
  • 1
  • 1
kmacdonald
  • 3,381
  • 2
  • 18
  • 22