<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[boost::asio read_until problem]]></title><description><![CDATA[<p>Mein server sendet einen Text:</p>
<pre><code>string msg = &quot;text1&quot;;
boost::asio::write(client, boost::asio::buffer(msg, msg.length()));
</code></pre>
<p>Der client liest ihn dann:</p>
<pre><code>boost::asio::streambuf readBuffer;
boost::asio::read_until(client, readBuffer, '1');
</code></pre>
<p>Nun soll der client 2 texte erhalten.</p>
<p>server:</p>
<pre><code>string msg = &quot;text1&quot;;
boost::asio::write(client, boost::asio::buffer(msg, msg.length()));
msg = &quot;text2&quot;;
boost::asio::write(client, boost::asio::buffer(msg, msg.length()));
</code></pre>
<p>client:</p>
<pre><code>boost::asio::streambuf readBuffer;
boost::asio::read_until(client, readBuffer, '1');
boost::asio::read_until(client, readBuffer, '2');
</code></pre>
<p>Aber am ende enthält readBuffer nicht &quot;text2&quot; sondern &quot;text1text2&quot;.</p>
<p>Wieso und wie kann ich das ändern?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/311003/boost-asio-read_until-problem</link><generator>RSS for Node</generator><lastBuildDate>Tue, 04 Aug 2026 00:32:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/311003.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 24 Nov 2012 17:00:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to boost::asio read_until problem on Sat, 24 Nov 2012 17:00:26 GMT]]></title><description><![CDATA[<p>Mein server sendet einen Text:</p>
<pre><code>string msg = &quot;text1&quot;;
boost::asio::write(client, boost::asio::buffer(msg, msg.length()));
</code></pre>
<p>Der client liest ihn dann:</p>
<pre><code>boost::asio::streambuf readBuffer;
boost::asio::read_until(client, readBuffer, '1');
</code></pre>
<p>Nun soll der client 2 texte erhalten.</p>
<p>server:</p>
<pre><code>string msg = &quot;text1&quot;;
boost::asio::write(client, boost::asio::buffer(msg, msg.length()));
msg = &quot;text2&quot;;
boost::asio::write(client, boost::asio::buffer(msg, msg.length()));
</code></pre>
<p>client:</p>
<pre><code>boost::asio::streambuf readBuffer;
boost::asio::read_until(client, readBuffer, '1');
boost::asio::read_until(client, readBuffer, '2');
</code></pre>
<p>Aber am ende enthält readBuffer nicht &quot;text2&quot; sondern &quot;text1text2&quot;.</p>
<p>Wieso und wie kann ich das ändern?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2274257</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2274257</guid><dc:creator><![CDATA[boostasio]]></dc:creator><pubDate>Sat, 24 Nov 2012 17:00:26 GMT</pubDate></item><item><title><![CDATA[Reply to boost::asio read_until problem on Sat, 24 Nov 2012 17:01:43 GMT]]></title><description><![CDATA[<p>'1' != &quot;1&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2274259</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2274259</guid><dc:creator><![CDATA[boxxx]]></dc:creator><pubDate>Sat, 24 Nov 2012 17:01:43 GMT</pubDate></item><item><title><![CDATA[Reply to boost::asio read_until problem on Sat, 24 Nov 2012 17:04:01 GMT]]></title><description><![CDATA[<p>weiß ich...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2274262</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2274262</guid><dc:creator><![CDATA[boostasio]]></dc:creator><pubDate>Sat, 24 Nov 2012 17:04:01 GMT</pubDate></item><item><title><![CDATA[Reply to boost::asio read_until problem on Sat, 24 Nov 2012 19:34:44 GMT]]></title><description><![CDATA[<p>Was erwartest Du?</p>
<p>Du hast EIN readBuffer und rufst danach einfach zweimal read_until(..) auf - logisch landet das in demselben Buffer hintereinander. Nimm entweder zwei Buffer oder entferne das gelesene nach dem ersten read_until(..) aus dem Buffer.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2274331</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2274331</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Sat, 24 Nov 2012 19:34:44 GMT</pubDate></item><item><title><![CDATA[Reply to boost::asio read_until problem on Sun, 25 Nov 2012 12:19:14 GMT]]></title><description><![CDATA[<p>Schau' dir mal die consume-Methode des streambuf an: <a href="http://www.boost.org/doc/libs/1_52_0/doc/html/boost_asio/reference/basic_streambuf/consume.html" rel="nofollow">http://www.boost.org/doc/libs/1_52_0/doc/html/boost_asio/reference/basic_streambuf/consume.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2274453</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2274453</guid><dc:creator><![CDATA[mantiz]]></dc:creator><pubDate>Sun, 25 Nov 2012 12:19:14 GMT</pubDate></item></channel></rss>