Fork me on GitHub

SuperSocket 1.5 Documentation译文 17 ----- 在SuperSocket中内置的Flash或Silverlight策略服务器

SuperSocket内置的FlashSilverlight政策的服务器

SuperSocket包含一个内置的Flash和Silverlight客户端套接字策略服务器。而且它的实现代码包含在SuperSocket.Facility.dll。因此,启用该策略服务器,你需要SuperSocket运行目录首先确保SuperSocket.Facility.dll存在,然后添加策略服务器的配置节点在配置文件中,如下面的代码。

Flash 策略服务器:

<?xml version="1.0"?>
<configuration>
    <configSections>
        <section name="superSocket" type="SuperSocket.SocketEngine.Configuration.SocketServiceConfig, SuperSocket.SocketEngine" />
    </configSections>
    <appSettings>
        <add key="ServiceName" value="SupperSocketService" />
    </appSettings>
    <superSocket>
        <servers>
            <server name="FlashPolicyServer"
                    serverType="SuperSocket.Facility.PolicyServer.FlashPolicyServer, SuperSocket.Facility"
                    ip="Any" port="843"
                    receiveBufferSize="32"
                    maxConnectionNumber="100"
                    policyFile="Policy\flash.xml"
                    clearIdleSession="true">
            </server>
        </servers>
    </superSocket>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
    </startup>
</configuration>

Silverlight 策略服务器:

<?xml version="1.0"?>
<configuration>
    <configSections>
        <section name="superSocket" type="SuperSocket.SocketEngine.Configuration.SocketServiceConfig, SuperSocket.SocketEngine" />
    </configSections>
    <appSettings>
        <add key="ServiceName" value="SupperSocketService" />
    </appSettings>
    <superSocket>
        <servers>
            <server name="SilverlightPolicyServer"
                    serverType="SuperSocket.Facility.PolicyServer.SilverlightPolicyServer, SuperSocket.Facility"
                    ip="Any" port="943"
                    receiveBufferSize="32"
                    maxConnectionNumber="100"
                    policyFile="Policy\silverlight.xml"
                    clearIdleSession="true">
            </server>
        </servers>
    </superSocket>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
    </startup>
</configuration>

注:策略文件存放路径是你的policyFile 属性

posted @ 2013-05-12 21:17  逗豆豆  阅读(312)  评论(0编辑  收藏  举报