Creates a secure stream that connects via the default credential
Inheritance: SecureStreamClientBase
コード例 #1
0
        void ClientBenchmarkDefault(object state)
        {
            Stream client = (Stream)state;
            var    sa     = new SecureStreamClientDefault();

            m_sw.Start();
            sa.TryAuthenticate(client, false);
            m_sw.Stop();
            System.Console.WriteLine(m_sw.Elapsed.TotalMilliseconds);

            m_sw.Restart();
            sa.TryAuthenticate(client);
            m_sw.Stop();
            System.Console.WriteLine(m_sw.Elapsed.TotalMilliseconds);

            m_sw.Restart();
            sa.TryAuthenticate(client, false);
            m_sw.Stop();
            System.Console.WriteLine(m_sw.Elapsed.TotalMilliseconds);

            m_sw.Restart();
            sa.TryAuthenticate(client);
            m_sw.Stop();
            System.Console.WriteLine(m_sw.Elapsed.TotalMilliseconds);

            m_sw.Restart();
            sa.TryAuthenticate(client, false);
            m_sw.Stop();
            System.Console.WriteLine(m_sw.Elapsed.TotalMilliseconds);
        }
コード例 #2
0
        void ClientDefault(object state)
        {
            Stream client = (Stream)state;
            SecureStreamClientDefault sa = new SecureStreamClientDefault();

            if (!sa.TryAuthenticate(client, true, out Stream stream))
            {
                throw new Exception();
            }

            if (stream.ReadString() != "Message")
            {
                throw new Exception();
            }
            stream.Write("Response");
            stream.Flush();
            stream.Dispose();
        }
コード例 #3
0
        void ClientDefault(object state)
        {
            Stream client = (Stream)state;
            var sa = new SecureStreamClientDefault();
            Stream stream;
            if (!sa.TryAuthenticate(client, true, out stream))
            {
                throw new Exception();
            }

            if (stream.ReadString() != "Message")
                throw new Exception();
            stream.Write("Response");
            stream.Flush();
            stream.Dispose();
        }
コード例 #4
0
        void ClientBenchmarkDefault(object state)
        {
            Stream client = (Stream)state;
            var sa = new SecureStreamClientDefault();
            m_sw.Start();
            sa.TryAuthenticate(client, false);
            m_sw.Stop();
            System.Console.WriteLine(m_sw.Elapsed.TotalMilliseconds);

            m_sw.Restart();
            sa.TryAuthenticate(client);
            m_sw.Stop();
            System.Console.WriteLine(m_sw.Elapsed.TotalMilliseconds);

            m_sw.Restart();
            sa.TryAuthenticate(client, false);
            m_sw.Stop();
            System.Console.WriteLine(m_sw.Elapsed.TotalMilliseconds);

            m_sw.Restart();
            sa.TryAuthenticate(client);
            m_sw.Stop();
            System.Console.WriteLine(m_sw.Elapsed.TotalMilliseconds);

            m_sw.Restart();
            sa.TryAuthenticate(client, false);
            m_sw.Stop();
            System.Console.WriteLine(m_sw.Elapsed.TotalMilliseconds);
        }