Example #1
0
        private void OnSslConnect(SslServer server)
        {
            SslSocket socket = server.Accept();
            WebThread thread = new WebThread(handler, socket);

            thread.Start();
        }
Example #2
0
 public bool Listen(int port = 80, int sslport = 443)
 {
     if (handler == null)
     {
         return(false);
     }
     if (port != -1)
     {
         tcp = new TcpServer();
         tcp.OnPending((TcpServer server) => { OnTcpConnect(server); });
         tcp.Listen(port);
     }
     if (sslport != -1)
     {
         ssl = new SslServer();
         ssl.OnPending((SslServer server) => { OnSslConnect(server); });
         ssl.Listen(sslport);
     }
     return(true);
 }