Exemplo n.º 1
0
        public static void LoadLocal()
        {
            string policy = LocalPolicy;

            _server = new SocketPolicyServer(policy);
            int result = _server.Start();
        }
Exemplo n.º 2
0
        public static void LoadPort(int startPort, int endPort)
        {
            string policy = string.Format(
                @"<?xml version='1.0'?>
              <cross-domain-policy>
	              <allow-access-from domain=""*"" to-ports=""{0}-{1}"" />
              </cross-domain-policy>", startPort, endPort);

            _server = new SocketPolicyServer(policy);
            int result = _server.Start();
        }
Exemplo n.º 3
0
        public static void LoadFile(string filename)
        {
            string policy = string.Empty;

            if (!File.Exists(filename))
            {
                Logger.LogError("Could not find policy file '{0}'.", filename);
                ;
                return;
            }
            using (StreamReader sr = new StreamReader(filename))
            {
                policy = sr.ReadToEnd();
            }
            _server = new SocketPolicyServer(policy);
            int result = _server.Start();
        }