Esempio n. 1
0
        void ProcessPolicyFile()
        {
            var     s   = new NetworkStream(skt);
            NWriter wtr = new NWriter(s);

            wtr.WriteNullTerminatedString(@"<cross-domain-policy>
			<allowed-access-from domain=""*"" to-ports=""*"" />
			</cross-domain-policy>"            );
            wtr.Write((byte)'\r');
            wtr.Write((byte)'\n');
            parent.Disconnect();
        }
Esempio n. 2
0
 static void ServePolicyFile(IAsyncResult ar)
 {
     TcpClient cli = (ar.AsyncState as TcpListener).EndAcceptTcpClient(ar);
     (ar.AsyncState as TcpListener).BeginAcceptTcpClient(ServePolicyFile, ar.AsyncState);
     try
     {
         var s = cli.GetStream();
         NReader rdr = new NReader(s);
         NWriter wtr = new NWriter(s);
         if (rdr.ReadNullTerminatedString() == "<policy-file-request/>")
         {
             wtr.WriteNullTerminatedString(@"<cross-domain-policy>
      <allow-access-from domain=""*"" to-ports=""*"" />
     </cross-domain-policy>");
             wtr.Write((byte)'\r');
             wtr.Write((byte)'\n');
         }
         cli.Close();
     }
     catch { }
 }
Esempio n. 3
0
        static void ServePolicyFile(IAsyncResult ar)
        {
            TcpClient cli = (ar.AsyncState as TcpListener).EndAcceptTcpClient(ar);

            (ar.AsyncState as TcpListener).BeginAcceptTcpClient(ServePolicyFile, ar.AsyncState);
            try
            {
                var     s   = cli.GetStream();
                NReader rdr = new NReader(s);
                NWriter wtr = new NWriter(s);
                if (rdr.ReadNullTerminatedString() == "<policy-file-request/>")
                {
                    wtr.WriteNullTerminatedString(@"<cross-domain-policy>
     <allow-access-from domain=""*"" to-ports=""*"" />
</cross-domain-policy>");
                    wtr.Write((byte)'\r');
                    wtr.Write((byte)'\n');
                }
                cli.Close();
            }
            catch { }
        }