Programmatically configure socket policy server

Sep 19, 2011 at 5:51 PM

Hi!

Can anyone provide an example of programmatically configuring and starting the flash socket policy server?

Thanks!

Sep 20, 2011 at 2:32 AM

 

var policyServer = new SilverlightPolicyServer();

var config = new ServerConfig();
config.Name = "SilverlightPolicyServer";
config.Mode = SocketMode.Async;
config.Ip = "Any";
config.Port = 2011;
config.Options = new System.Collections.Specialized.NameValueCollection();
config.Options.Add("policyFile", "Policy\silverlight.xml");

policyServer.Setup(new RootConfig(), config, SocketServerFactory.Instance);

policyServer.Start();
Sep 20, 2011 at 9:43 AM

Thanks a lot!