Esempio n. 1
0
 /// <summary>
 /// 开始处理新的请求
 /// </summary>
 /// <param name="server">HTTP 服务</param>
 /// <param name="socket">套接字</param>
 internal void Start(SslServer server, ref System.Net.Sockets.Socket socket)
 {
     Socket      = socket;
     this.Server = server;
     socket      = null;
     try
     {
         SslCertificate certificate = server.Certificate;
         if (certificate != null)
         {
             SslStream = certificate.CreateSslStream(this);
         }
         else
         {
             NetworkStream = new NetworkStream(Socket, true);
             if (HelloStream == null)
             {
                 HelloStream = new ServerNameIndication.HelloStream(this);
             }
             HelloStream.ReadHello();
         }
         return;
     }
     catch (Exception error)
     {
         server.RegisterServer.TcpServer.Log.Exception(error, null, LogLevel.Exception | LogLevel.AutoCSer);
     }
     HeaderError();
 }
Esempio n. 2
0
 /// <summary>
 /// 开始处理新的请求
 /// </summary>
 /// <param name="server">HTTP 服务</param>
 /// <param name="socket">套接字</param>
 internal void Start(SslServer server, ref System.Net.Sockets.Socket socket)
 {
     Socket      = socket;
     this.Server = server;
     socket      = null;
     try
     {
         SslCertificate certificate = server.Certificate;
         if (certificate != null)
         {
             SslStream = certificate.CreateSslStream(this);
         }
         else
         {
             NetworkStream = new NetworkStream(Socket, true);
             if (HelloStream == null)
             {
                 HelloStream = new ServerNameIndication.HelloStream(this);
             }
             HelloStream.ReadHello();
         }
         return;
     }
     catch (Exception error)
     {
         Console.WriteLine(error.ToString());
         server.RegisterServer.TcpServer.Log.Add(Log.LogType.Debug, error);
     }
     HeaderError();
 }