开发者

Silverlight 4 sockets to local programme

开发者 https://www.devze.com 2023-01-11 02:14 出处:网络
I\'m trying to get silverlight to communicate via sockets to a third party app running on the client machine.

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?


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消