<?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[Winsock lost connection?]]></title><description><![CDATA[<p>Hey!</p>
<p>Wie kann ich herausfinden, ob eine Seite die Verbindung beendet hat?<br />
Per if(recv(...) == 0) funzt es nicht, es wird nämlich, sobald eine Seite schließt, ein buffer voller undefinierter Zeichen gesendet.</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/192548/winsock-lost-connection</link><generator>RSS for Node</generator><lastBuildDate>Wed, 01 Jul 2026 00:32:06 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/192548.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 15 Sep 2007 22:03:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Winsock lost connection? on Sat, 15 Sep 2007 22:03:34 GMT]]></title><description><![CDATA[<p>Hey!</p>
<p>Wie kann ich herausfinden, ob eine Seite die Verbindung beendet hat?<br />
Per if(recv(...) == 0) funzt es nicht, es wird nämlich, sobald eine Seite schließt, ein buffer voller undefinierter Zeichen gesendet.</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1366111</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1366111</guid><dc:creator><![CDATA[ceplusplus@loggedoff]]></dc:creator><pubDate>Sat, 15 Sep 2007 22:03:34 GMT</pubDate></item><item><title><![CDATA[Reply to Winsock lost connection? on Sat, 15 Sep 2007 22:04:34 GMT]]></title><description><![CDATA[<p>Besser gesagt empfangen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1366112</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1366112</guid><dc:creator><![CDATA[ceplusplus@loggedoff]]></dc:creator><pubDate>Sat, 15 Sep 2007 22:04:34 GMT</pubDate></item><item><title><![CDATA[Reply to Winsock lost connection? on Sat, 15 Sep 2007 22:14:19 GMT]]></title><description><![CDATA[<p>quatsch</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1366114</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1366114</guid><dc:creator><![CDATA[wurscht]]></dc:creator><pubDate>Sat, 15 Sep 2007 22:14:19 GMT</pubDate></item><item><title><![CDATA[Reply to Winsock lost connection? on Sat, 15 Sep 2007 22:29:27 GMT]]></title><description><![CDATA[<p>Is so.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1366117</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1366117</guid><dc:creator><![CDATA[ceplusplus@loggedoff]]></dc:creator><pubDate>Sat, 15 Sep 2007 22:29:27 GMT</pubDate></item><item><title><![CDATA[Reply to Winsock lost connection? on Sat, 15 Sep 2007 22:35:24 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">void PacketHandler::receiveThread()
{
	while(!connectionLost)
	{
		char buffer[128];
		int received = recv(activeSocket, buffer, 128, 0);

		buffer[received] = '\0';

		MessageBox(0, ((std::string)buffer).c_str(), 0, 0);

		if(received == 0)
			MessageBox(0, &quot;LOST&quot;, 0, 0);

		data.push_back(buffer);
	}
}
</code></pre>
<p>LOST wird nie angezeigt, wenn ich eine Seite schließe. Aber eine Wirrwarr-Zeichenkette sehrwohl.</p>
<p>Davor ist aber alles ganz normal, also ich kann korrekt Senden &amp; Empfangen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1366118</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1366118</guid><dc:creator><![CDATA[ceplusplus@loggedoff]]></dc:creator><pubDate>Sat, 15 Sep 2007 22:35:24 GMT</pubDate></item><item><title><![CDATA[Reply to Winsock lost connection? on Sat, 15 Sep 2007 22:39:08 GMT]]></title><description><![CDATA[<blockquote>
<pre><code class="language-cpp">((std::string)buffer).c_str()
</code></pre>
</blockquote>
<p>What the fuck!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1366119</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1366119</guid><dc:creator><![CDATA[omg]]></dc:creator><pubDate>Sat, 15 Sep 2007 22:39:08 GMT</pubDate></item><item><title><![CDATA[Reply to Winsock lost connection? on Sat, 15 Sep 2007 22:56:50 GMT]]></title><description><![CDATA[<p>Jojo, aber liegts dran?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1366124</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1366124</guid><dc:creator><![CDATA[ceplusplus@loggedoff]]></dc:creator><pubDate>Sat, 15 Sep 2007 22:56:50 GMT</pubDate></item><item><title><![CDATA[Reply to Winsock lost connection? on Sun, 16 Sep 2007 02:03:48 GMT]]></title><description><![CDATA[<p>recv @msdn:</p>
<p>If the connection has been gracefully closed, the return value is zero. Otherwise, a value of SOCKET_ERROR is returned.</p>
<p>Und was ist gracefully laut MS? Also ich hab jetzt grade bemerkt, dass -1 zurückgegeben wird, sobald ich eine Seite schließe... In vielen tutorials wird nach 0 abgefragt. Nun gut, ich schließe per &quot;X&quot; das Konsolenfenster...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1366145</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1366145</guid><dc:creator><![CDATA[ceplusplus@loggedoff]]></dc:creator><pubDate>Sun, 16 Sep 2007 02:03:48 GMT</pubDate></item><item><title><![CDATA[Reply to Winsock lost connection? on Sun, 16 Sep 2007 08:14:16 GMT]]></title><description><![CDATA[<p>das bedeuted wohl mit close() und nicht einfach durch schließen abgebrochen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1366164</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1366164</guid><dc:creator><![CDATA[fdsfsdfsd]]></dc:creator><pubDate>Sun, 16 Sep 2007 08:14:16 GMT</pubDate></item><item><title><![CDATA[Reply to Winsock lost connection? on Sun, 16 Sep 2007 11:34:01 GMT]]></title><description><![CDATA[<p>Mhm ok.</p>
<p>Aber close rufe ich im Destruktor meiner Klasse auf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1366260</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1366260</guid><dc:creator><![CDATA[ceplusplus@loggedoff]]></dc:creator><pubDate>Sun, 16 Sep 2007 11:34:01 GMT</pubDate></item></channel></rss>