title: Display complete stream of response using Data Writer Stream Sockets, Windows phone 8
body: <p>i am working on winRT stream sockets of windows phone 8 at client side.My code is</p>
  
  <pre><code>  var streamScoket = new StreamSocket();
          await streamScoket.ConnectAsync(new HostName(txtServer.Text), portNumber.ToString(), SocketProtectionLevel.PlainSocket);
  
          DataWriter dw = new DataWriter(streamScoket.OutputStream);
  
          dw.WriteString("Hello");
  
          await dw.StoreAsync();
  
          DataReader reader = new DataReader(streamScoket.InputStream);
  
          reader.InputStreamOptions = InputStreamOptions.Partial;
  
          await reader.LoadAsync(4);
  
          string data = string.Empty;
  
          while (reader.UnconsumedBufferLength &gt; 0)
          {
              data += reader.ReadString(reader.UnconsumedBufferLength);
          }
  
          txtConnections.Text = data;
          }
  </code></pre>
  
  <p>At server side when i passing "Hello",I am sending a response of "Good you are receiving a message from server" of this text. But in my "txtconnections" textbox only "Good" text is displayed as i know i have passed "4" in "LoadAsync". If i increase "4" to more value i can display all the content. But as Tcp operates on stream of data how did we know the response stream come to end or how will we continue the looping if we have "4" in the "loadasync". Can some one please help me to find the solution and explain me briefly.. And here "UnconsumedBufferLength" contains "4" and from next onwards it was "0"...</p>