コード例 #1
0
        public RequestManager(ServerClass serverClass)
        {
            this.serverClass = serverClass;

            utf8 = new UTF8Encoding();

            Log.Write("Starting to generate public/private key pair.");
            waitForKeyGeneration = new EventWaitHandle(false, EventResetMode.ManualReset);
            rsa = new RSACrypto();
            rsa.OnKeysGenerated += new RSACrypto.KeysGenerated(KeyGenerated);
            rsa.GenerateKeys(2048);

            aes = new AesManaged();

            listener = new HttpListener();
            listener.Prefixes.Add("http://*:80/");
            alive = false;

            Log.Write("Request manager created, and ready to start server.");
        }