I'm using the SuperSocket Socket Service (SuperSocket.SocketService.exe) as my Silverlight policy server but the service is not being hit and my policy not returned. I can connect to the service through Hercules however.
I've enabled the built in Flash Silverlight policy server by adding it to my configuration file as explained here. The SuperSocket.Facility.dll exists in my service's run directory along with 3 other required dlls.
Service configuration file:
<?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>
The policy server starts fine:
Connection from Silverlight which fails:
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...");
}