【问题标题】:SuperSocket Silverlight policy server not being hit and policy not downloadedSuperSocket Silverlight 策略服务器未命中且未下载策略
【发布时间】:2014-10-21 21:52:23
【问题描述】:

我正在使用 SuperSocket 套接字服务 (SuperSocket.SocketService.exe) 作为我的 Silverlight 策略服务器,但 服务没有受到影响,我的策略也没有返回。不过,我可以通过 Hercules 连接到该服务。

按照here 的说明,我已通过将内置 Flash Silverlight 策略服务器添加到我的配置文件中来启用它。 SuperSocket.Facility.dll 与其他 3 个必需的 dll 一起存在于我的服务的运行目录中。

服务配置文件:

<?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="D:\policyserver\SLPolicy.xml"
                clearIdleSession="true">
        </server>
    </servers>
</superSocket>
<startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>

策略服务器启动正常:

来自 Silverlight 的连接失败

var webSocketClient = new WebSocket(string.Format("ws://127.0.0.1:{0}/websocket", 943, "basic", version));            
webSocketClient.Opened += new EventHandler(webSocketClient_Opened);
webSocketClient.Closed += new EventHandler(webSocketClient_Closed);
webSocketClient.DataReceived += new EventHandler<DataReceivedEventArgs>(webSocketClient_DataReceived);
webSocketClient.MessageReceived += new EventHandler<MessageReceivedEventArgs>(webSocketClient_MessageReceived);

if (autoConnect)
{
    webSocketClient.Open();

    if (!OpenedEvent.WaitOne(1000))
        throw new Exception("Cannot connect...");
 }

【问题讨论】:

    标签: c# silverlight owin supersocket.net


    【解决方案1】:

    我从来没有解决这个问题,由于各种原因中止了这个项目。

    我用 MEAN JS 重写了它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-31
      • 2010-09-09
      • 2020-06-30
      • 1970-01-01
      • 2020-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多