title: How to send a "hello" to server and reply a "hi"?
body: <p>With my code I can read a message on the server and write from the client. But I am not being able to write a response from the server and read in the client.</p>
  
  <p>The code on the <code>client</code></p>
  
  <pre><code>var cli = new TcpClient();
  
  cli.Connect("127.0.0.1", 6800);
  
  string data = String.Empty;
  
  using (var ns = cli.GetStream())
  {
      using (var sw = new StreamWriter(ns))
      {
          sw.Write("Hello");
          sw.Flush();
  
          //using (var sr = new StreamReader(ns))
          //{
          //    data = sr.ReadToEnd();
          //}
      }
  }
  
  cli.Close();
  </code></pre>
  
  <p>The code on the <code>server</code></p>
  
  <pre><code>tcpListener = new TcpListener(IPAddress.Any, port);
  tcpListener.Start();
  
  while (run)
  {
      var client = tcpListener.AcceptTcpClient();
  
      string data = String.Empty;
  
      using (var ns = client.GetStream())
      {
          using (var sr = new StreamReader(ns))
          {
              data = sr.ReadToEnd();
  
              //using (var sw = new StreamWriter(ns))
              //{
              //    sw.WriteLine("Hi");
              //    sw.Flush();
              //}
          }
      }
      client.Close();
  }
  </code></pre>
  
  <p>How can I make the server reply after reading the data and make the client read this data?</p>