我开10个线程,发现只打开2个连接,我开100个线程,还是2个连接,真faint呀,大牛们帮忙。
开100个线程不比开10个线程快多少,真郁闷。(好像带宽利用的也差不多)

解决方案 »

  1.   

    问题解决了,在MSDN里面找到了。You can configure WinInet to exceed this limit by creating and setting the registry entries below NOTE: By changing these settings you are causing WinInet to break the HTTP protocol specification for your application and any other WinInet applications running on your machine, including Internet Explorer. You should only do this if absolutely necessary and then you should avoid doing standard Web browsing while these settings are in effect: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet SettingsMaxConnectionsPerServer REG_DWORD (Default 2) 
    Sets the number of simultaneous requests to a single HTTP 1.1 ServerMaxConnectionsPer1_0Server REG_DWORD (Default 4) 
    Sets the number of simultaneous requests to a single HTTP 1.0 Server 
    These settings are made for a particular user and will have no affect on other users who log onto the machine. In Internet Explorer 5, it is possible to change the connection limit programmatically by calling the InternetSetOption API on NULL handle with the following flags (note that it will change connection limit for the entire process): 
    INTERNET_OPTION_MAX_CONNS_PER_SERVER INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER