Esempio n. 1
0
        public void HandleClient(TcpClient client)
        {
            StreamReader reader  = new StreamReader(client.GetStream());
            string       message = "";

            while (reader.Peek() != -1)
            {
                message = message + reader.ReadLine() + "\n";
            }

            Request  request  = Request.GetRequest(message);
            Response response = new Response();

            response.Post(client, request.Url);
        }
Esempio n. 2
0
        private void HandleClient(TcpClient client)
        {
            StreamReader reader = new StreamReader(client.GetStream());
            string       msg    = "";

            while (reader.Peek() != -1)
            {
                msg += reader.ReadLine() + "\n";
            }
            Debug.WriteLine("Request: \n" + msg);

            Request  req  = Request.GetRequest(msg);
            Response resp = Response.From(req);

            resp.Post(client.GetStream());
        }
Esempio n. 3
0
        public void HandleClient(TcpClient client)
        {
            StreamReader reader = new System.IO.StreamReader(client.GetStream());
            string       msg    = "";

            if (reader.Peek() != -1)
            {
                msg += reader.ReadLine() + "\n";
            }
            Console.WriteLine("Request " + msg);
            Request  request  = Request.GetRequest(msg);
            Response response = Response.From(request);

            response.Post(client.GetStream());
            client.Close();
        }