/// <summary> /// Authenticates with the remote server. /// </summary> /// <param name="stream">the stream to authentication on</param> /// <param name="certSignatures"></param> /// <returns></returns> protected override bool InternalTryAuthenticate(Stream stream, byte[] certSignatures) { stream.WriteByte((byte)AuthenticationMode.Integrated); if (m_client.TryAuthenticateAsClient(stream, certSignatures)) { return(true); } return(false); }
void Client1(object state) { Stream client = (Stream)state; IntegratedSecurityClient sa = new IntegratedSecurityClient(); m_sw.Start(); _ = sa.TryAuthenticateAsClient(client); m_sw.Stop(); System.Console.WriteLine(m_sw.Elapsed.TotalMilliseconds); m_sw.Restart(); bool success = sa.TryAuthenticateAsClient(client); m_sw.Stop(); System.Console.WriteLine(m_sw.Elapsed.TotalMilliseconds); if (!success) { throw new Exception(); } }