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); }
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()); }
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(); }