Ejemplo n.º 1
0
        public void Listen()
        {
            listener = new TcpListener(IPAddress.Parse("127.0.0.1"), portNum);

            listener.Start();

            Console.WriteLine("    Website HTTP initialized, listening on port: " + portNum.ToString() + ".");
            Console.WriteLine("Server is running!");
            Console.WriteLine("");
            while (true)
            {
                CsHTTPRequest newRequest = new CsHTTPRequest(listener.AcceptTcpClient(), this);
                Thread Thread = new Thread(new ThreadStart(newRequest.Process));
                Thread.Name = "HTTP Request";
                Thread.Start();
            }
        }
Ejemplo n.º 2
0
        public void Listen()
        {
            listener = new TcpListener(IPAddress.Parse("127.0.0.1"), portNum);

            listener.Start();

            Console.WriteLine("    Website HTTP initialized, listening on port: " + portNum.ToString() + ".");
            Console.WriteLine("Server is running!");
            Console.WriteLine("");
            while (true)
            {
                CsHTTPRequest newRequest = new CsHTTPRequest(listener.AcceptTcpClient(), this);
                Thread        Thread     = new Thread(new ThreadStart(newRequest.Process));
                Thread.Name = "HTTP Request";
                Thread.Start();
            }
        }
Ejemplo n.º 3
0
        public void Listen()
        {
            bool done = false;

            listener = new TcpListener(IPAddress.Any, portNum);

            listener.Start();

            WriteLog("Listening On: " + portNum.ToString());

            while (!done)
            {
                WriteLog("Waiting for connection...");
                CsHTTPRequest newRequest = new CsHTTPRequest(listener.AcceptTcpClient(), this);
                Thread        Thread     = new Thread(new ThreadStart(newRequest.Process));
                Thread.Name = "HTTP Request";
                Thread.Start();
            }
        }