<?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 async_read timeout]]></title><description><![CDATA[<p>Hallo</p>
<p>Wie kann ich realisieren, dass die async_read Funktion nicht ewig auf daten wartet? Unter Windows XP kann ich ja nicht in dem Handler von einem deadline_timer socket::cancel() aufrufen. Gibt's da einen anderen Ansatz? Den io_service darf ich auch nicht stoppen, weil sonst bei den anderen Thrads die run() Funktion vorzeitig zurückehrt.</p>
<p>Danke...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/276279/boost-asio-async_read-timeout</link><generator>RSS for Node</generator><lastBuildDate>Wed, 26 Aug 2026 11:01:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/276279.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 30 Oct 2010 10:25:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to boost::asio async_read timeout on Sat, 30 Oct 2010 10:25:16 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Wie kann ich realisieren, dass die async_read Funktion nicht ewig auf daten wartet? Unter Windows XP kann ich ja nicht in dem Handler von einem deadline_timer socket::cancel() aufrufen. Gibt's da einen anderen Ansatz? Den io_service darf ich auch nicht stoppen, weil sonst bei den anderen Thrads die run() Funktion vorzeitig zurückehrt.</p>
<p>Danke...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1972621</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1972621</guid><dc:creator><![CDATA[__Stefan__]]></dc:creator><pubDate>Sat, 30 Oct 2010 10:25:16 GMT</pubDate></item><item><title><![CDATA[Reply to boost::asio async_read timeout on Sat, 30 Oct 2010 10:36:58 GMT]]></title><description><![CDATA[<p>shutdown auf dem socket aufrufen (für die empfangsseite).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1972624</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1972624</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Sat, 30 Oct 2010 10:36:58 GMT</pubDate></item><item><title><![CDATA[Reply to boost::asio async_read timeout on Sat, 30 Oct 2010 10:56:52 GMT]]></title><description><![CDATA[<p>theta schrieb:</p>
<blockquote>
<p>shutdown auf dem socket aufrufen (für die empfangsseite).</p>
</blockquote>
<p>Muss ich das vor dem nächsten Receive-Vorgang irgendwie rückgängig machen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1972635</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1972635</guid><dc:creator><![CDATA[__Stefan__]]></dc:creator><pubDate>Sat, 30 Oct 2010 10:56:52 GMT</pubDate></item><item><title><![CDATA[Reply to boost::asio async_read timeout on Sat, 30 Oct 2010 11:14:19 GMT]]></title><description><![CDATA[<p>Ich denke ich habe dich falsch verstanden.<br />
shutdown(..) sollst Du nur benutzen, wenn Du die Verbindung herunterfahren willst (=Socket schliessen).</p>
<p>Warum möchtest Du nicht, dass async_read solange waretet bis eben Daten anliegen oder die Verbindung heruntergefahren wird?</p>
<p>Bräuchtest Du ein (blockierendes) read mit timeout?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1972643</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1972643</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Sat, 30 Oct 2010 11:14:19 GMT</pubDate></item><item><title><![CDATA[Reply to boost::asio async_read timeout on Sat, 30 Oct 2010 12:11:09 GMT]]></title><description><![CDATA[<p>theta schrieb:</p>
<blockquote>
<p>Bräuchtest Du ein (blockierendes) read mit timeout?</p>
</blockquote>
<p>Ja, genau. Read und write mit timeout, und keines soll das andere blockieren.<br />
Ich möchte so ein Interface erreichen:</p>
<pre><code class="language-cpp">// Versteckt
struct ConnectionImpl
{
	boost::asio::io_service io_service;
	boost::asio::ip::tcp::socket socket;
	// etc.
};

// C Interface

typedef void* Connection;

int Open(Connection** con, const char* address, unsigned short port, int timeout_ms);

int Close(Connection* con, int timeout_ms);

// Read und Write können parallel in separaten Threads ablaufen

int Write(Connection* con, const char* buf, size_t n, int timeout_ms);

int Read(Connection* con, char* buf, size_t n, int timeout_ms);
</code></pre>
<p>Eine Funktion soll entweder erfolgreich sein oden nach timeout_ms zurückkehren. Sollte ich vielleicht besser eine ander Lib benutzen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1972660</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1972660</guid><dc:creator><![CDATA[__Stefan__]]></dc:creator><pubDate>Sat, 30 Oct 2010 12:11:09 GMT</pubDate></item></channel></rss>