简体   繁体   English

WPF浏览器的并发连接

[英]Concurrent Connections with WPF Browser

I'm trying to run some tests against SignalR so we can use it in our product but first it needs to pass a small load test that ive been set. 我正在尝试对SignalR进行一些测试,以便我们可以在产品中使用它,但是首先,它需要通过一个已设置的小负载测试。

What iv done is wrote a small app that basically creates x number of WPF browser controls and points them at my machine.. This works fine which all the JavaScript and everything working.. iv完成的是编写了一个小应用程序,该应用程序基本上创建了x个WPF浏览器控件,并将它们指向我的机器。

my problem is that only 2 of the x browser connect to Signal R, ive had a look and apparently its something to do with concurrent connections so I tried setting 我的问题是x浏览器中只有2个连接到Signal R,我看了一下,显然与并发连接有关,所以我尝试设置

  <system.net>
<connectionManagement>
  <add address="*" maxconnection="100" />
</connectionManagement>

but that did not work, I also tried 但这没有用,我也尝试过

     ServicePointManager.DefaultConnectionLimit = 200;

that also didnt solve it.. 那也没有解决。

Im pulling my hair out here trying to get it to work! 我在这里拔头发试图使其正常工作! any ideas? 有任何想法吗? I cant exactly do a load test with only 2 connection clients hehe! 我不能只用2个连接客户端来做负载测试!

some code; 一些代码;

  private void Create(object o)
    {

        for (int i = 0; i < this.Users; i++)
        {
            StressResult result = new StressResult { BrowserInstance = new WebBrowser(), Id = i };

            this.Results.Add(result);
        }

    }

    private void StartRun(object obj)
    {
        foreach (StressResult result in this.Results)
        {
            result.BrowserInstance.Navigate(this.Target);
        }
    }

Create is run first so that the browsers can load, then we finally do the navigation. 首先运行Create,以便浏览器可以加载,然后最后进行导航。

Most likely the WPF browser component is a wrapper around the unmanaged Internet Explorer core web browser component. WPF浏览器组件很可能是非托管Internet Explorer核心Web浏览器组件的包装。 Try to change the registry key as described: 尝试按照以下说明更改注册表项:

  1. Start Registry Editor. 启动注册表编辑器。
  2. Locate the following key in the registry: HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings 在注册表中找到以下项:HKEY_CURRENT_USER \\ Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Internet设置
  3. On the Edit menu, point to New, click DWORD Value, and then add the following registry values: Value name: MaxConnectionsPer1_0Server 在编辑菜单上指向新建,单击DWORD值,然后添加以下注册表值:值名称:MaxConnectionsPer1_0Server
    Value data: 10 价值数据:10
    Base: Decimal 基数:十进制
    Value Name: MaxConnectionsPerServer 值名称:MaxConnectionsPerServer
    Value data: 10 价值数据:10
    Base: Decimal 基数:十进制

For Internet Explorer 8 & 9 and global keys as well as GPOs, see the link below. 有关Internet Explorer 8和9和全局密钥以及GPO,请参见下面的链接。

This is described in this knowledge base article: 在此知识库文章中对此进行了描述:
How do I configure Internet Explorer to download more than two files at one time? 如何配置Internet Explorer一次下载两个以上的文件?

Also, see this: SignalR and Browser Connection limit 另外,请参阅以下内容: SignalR和浏览器连接限制

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM