Is there any concurrent HTTP requests limitation f

2019-05-03 09:50发布

问题:

I know that RFC requires UserAgent to have a limit of max 2 http connection to single server. In fact, most browsers have the limit larger than 2.

The question is whether Silverlight have such limitation. Does it follow limit of hosting web browser? or does it has its own max connection limit?

回答1:

I don't now the exact answer to your question, but Silverlight 2 uses the browser HTTP stack and probably is limited to what it will do. In Silverlight 3 you have a choice between the browser stack and a new Silverlight stack. I don't know if the new stack is limited to two simultaneous connections to the same site, but it should be possible to check this by creating a small test program.



回答2:

SL will use the browsers http stack to make requests (in SL3 you can skip round the browser itself but you will still end up using a client side stack like WinINET which is still limited).



回答3:

According to RFC 2068:

"Clients that use persistent connections SHOULD limit the number of simultaneous connections that they maintain to a given server. A single-user client SHOULD maintain AT MOST 2 connections with any server or proxy. A proxy SHOULD use up to 2*N connections to another server or proxy, where N is the number of simultaneously active users. These guidelines are intended to improve HTTP response times and avoid congestion of the Internet or other networks."

Windows certainly enforces this limit across the operating system, but you can fix that changing the registry keys located at:

My Computer\HKEY_USERS(current user sid)\Software\Microsoft\Windows\CurrentVersion\Internet Setting\

The keys to change are:

MaxConnectionsPer1_0Server MaxConnectionsPerServer

You can set them to values above their default to increase the Windows limitation. That's OS specific though and may still be limited by the browser, though as Anthony points out you can get around the browser all together using the new networking stack in SL3.

I think it's good to play nice with the RFC spec (I'm sure there was a good reason for it) and keep your number of simultaneous connections limited to 2 per server. If you need more then maybe you can look for a protocol other than HTTP that would better suit your needs.