title: Receiving message string with zmq in C++
body: <p>I am trying to connect a simple c++ client to a GPS server using tcp with Zero MQ. I don't control the GPS server.</p>
  
  <p>The gps server sends : $GPGGA,143949.8330,520168215,N,00831.385282,E,,,,173.856,M,,,,*26</p>
  
  <p>But when i print the result, my client have splitted the answer:</p>
  
  <p>$GPGGA,143949.8330,5201</p>
  
  <p>68215,N,00831.385282,E,,,,173.856,M,,,,*26</p>
  
  <p>I can't say wait for 123 bytes of data since the NMEA string can vary in size.</p>
  
  <p>This is my code :</p>
  
  <pre><code>#include &lt;zmqpp/zmqpp.hpp&gt;
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  
  int main(void){
  
      const std::string endpoint = "tcp://127.0.0.1:3000";
  
      // initialize the 0MQ context
      zmqpp::context context;
  
      zmqpp::socket_type type = zmqpp::socket_type::pull;
      zmqpp::socket socket(context, type);
  
      socket.connect(endpoint);
  
  
      while(true){
  
          std::string data_str{""};
          socket.receive(data_str);
  
          std::cout &lt;&lt; data_str &lt;&lt; std::endl;
  
      }
  
      return 0;
  }
  </code></pre>
  
  <p>Can I solve this issue without stitching the strings together ?</p>
  
  <p>Thanks</p>