Silverlight Sockets restriction
W开发者_如何学Chy are sockets restricted to ports 4502-4534 only in silverlight ?
Is it just a security restriction or there is more into it ?
This is a way to identify and segregate the network traffic for silverlight and yes it is a security decision of Microsoft based on the restricted sandboxed web trust model.
An excellent explanation can be found here http://blogs.msdn.com/b/ncl/archive/2009/06/23/why-does-silverlight-have-a-restricted-port-range-for-sockets.aspx
It's part of the security model they put in place for Silverlight 2.
Interestingly from Silverlight 4 onwards:
On Silverlight version 4, trusted applications have also been given permission to use the networking classes in the System.Net.Sockets namespace including the new UdpAnySourceMulticastClient and UdpSingleSourceMulticastClient classes without policy checks. A trusted application is able to create a TCP connection to any port on any host without the need for a cross-domain policy file. The destination port is no longer required to be within the range of 4502-4534.
Network Security Access Restrictions in Silverlight on MSDN.
This page has a lot of information on this topic.
精彩评论