views:

41

answers:

2

Hi, I'm trying to get silverlight to communicate via sockets to a third party app running on the client machine. I can get it working if my app rus out of browser with elevated permissions. In browser without elevated permissions, it fails to connect. So I reckon my problem is with SocketClientAccessPolicyProtocol and configuring my clientaccesspolicy.xml. I have to connect on port 30500 locally. My clientaccesspolicy.xml file:

<?xml version="1.0" encoding ="utf-8"?>
<access-policy>
 <cross-domain-access>
    <policy>
      <allow-from  http-methods="*">
        <domain uri="*" />
       <domain uri="http://localhost:10873/" />
        <domain uri="http://localhost:49505/" />
        <domain uri="http://localhost:30500/" />
        <domain uri="127.0.0.1:30500" />
        <domain uri="127.0.0.1" />
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true" />
        <socket-resource port="30500" protocol="tcp" />
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>

Any ideas?

A: 

Silverlight restricts the ports of TCP socket connections to the range 4502 – 4534

Mike
A: 

It's my understanding that Silverlight 4 is supposed to allow you to over-ride that using the SocketClientAccessPolicyProtocol.xml file. Something like http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2010/03/20/silverlight-4-rc-socket-security-changes.aspx

Andy
I changed the port the 3rd party system listens on and my silverlight works. So the limited ports is the problem. Not all 3rd party software is going to allow you to do that, so I see this behaviour as a flaw.
Andy