title: TCP connection - strings are recieved mixed
body: <p>I have a TCP server in Java and a client in C#. The connection already exists and a few messages can be sent, but when I am writing many messages to the server I receive when the stream is closing something like that </p>
  
  <p><code>LOCATION|015|0LOCATION|014,99163|0LOCATION|014,89123|0LOCATION|014,81594|0LOCATION|014,78247|0LOCATION|014,74063|0LOCATION|014,69043|0LOCATION|014,63187|0LOCATION|014,56493|0LOCATION|014,56493|0LOCATION|014,3976|0LOCATION|014,3976|0LOCATION|014,2972|0LOCATION|014,18843|0LOCATION|014,0713|0LOCATION|0,000219846914,07641|-0,000412796LOCATION|0,000259</code></p>
  
  <p>in one line, instead of <code>LOCATION|UniversumGames|double;double;double</code> in one line.
  Can please somebody help?
  P.S.the Client cannot be wrong, because i used the same like in my twitchbot....</p>
  
  <p>Server code (Java):</p>
  
  <pre><code>public void run(){
      try{
          BufferedReader in = new BufferedReader((new InputStreamReader(socket.getInputStream())));
          PrintWriter out = new PrintWriter(socket.getOutputStream());
          DataInputStream dataInputStream = new DataInputStream(socket.getInputStream());
  
          out.println("Connected");
          out.flush();
          out.write("Connected 1");
          out.flush();
  
          while(socket.isConnected()){
              String line = in.readLine();
              //String line = dataInputStream.readUTF();
              if(line != null){
                  CommandController.control(new Data(line), socket);
              }
          }
      }catch(Exception e){
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>Client Code(c#):</p>
  
  <pre><code>private TcpClient tcpClient;
      private NetworkStream stream;
      private StreamReader reader;
      private StreamWriter writer;
      private bool recieve;
  
  
      public ClientConnection()
      {
          this.recieve = true;
          this.tcpClient = new TcpClient("127.0.0.1", 2700);
          Console.WriteLine("Connecting.....");
          // use the ipaddress as in the server program
  
          Console.WriteLine("Connected");
          this.stream = tcpClient.GetStream();
          this.writer = new StreamWriter(stream);
          this.reader = new StreamReader(stream);
  
          Console.WriteLine("Transmitting.....");
  
          this.writer.AutoFlush = true;
          writer.WriteLine("Connected clientside sucessful");
          writer.WriteLine("Connected clientside sucessful 1");
          writer.WriteLine("Connected clientside sucessful 2");
          writer.WriteLine("Connected clientside sucessful 3");
      }
  
      public async void Recieve()
      {
          await Task.Run(()=&gt;RecieveString());
      }
  
      public string RecieveString()
      {
          this.recieve = true;
          while (recieve)
          {
              //if (stream.DataAvailable)
              //{
                  string data = reader.ReadLine();
                  if (data != null)
                  {
                  writer.WriteLine(data + " recieved");
                  writer.Flush();
                      return data;
                  }
                  else return "";
              //}   
              //else return "";
          }
          return "";
      }
  </code></pre>