<?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[Socket (CAsyncSocket) in Thread (CWinThread)]]></title><description><![CDATA[<p>Hallo</p>
<p>Habe eine grosses Problem.</p>
<p>Und zwar starte ich in meiner Applikation ein Thread und in diesem<br />
erstelle ich ein Objekt von CAsyncSocket und setze dieses auf Listen().</p>
<p>Jetzt wenn ich das Programm schliesse, will ich zuerst das Socket schliessen, dann das Thread und anschliessend das ganze Programm.</p>
<p>So sieht es bis jetzt aus:</p>
<pre><code class="language-cpp">void CChatDlg::OnCancel()
{
        // thread schliessen
	delete m_pServerThread;

	// Programm beenden
	PostQuitMessage(0);
}
</code></pre>
<p>Im Destruktor vom Thread &quot;versuche&quot; ich noch das Socket zu schliessen.</p>
<p>Doch wenn ich das Programm ausführe kommt beim Debuggen ein Fehler in Sockcore.cpp Linie 541:</p>
<pre><code class="language-cpp">ASSERT(CAsyncSocket::LookupHandle(hSocket, FALSE) != NULL);
</code></pre>
<p>Diese Meldung kommt immer! Egal ob ich versuche das Socket zu schliessen oder nicht.</p>
<p>Wie muss ich das lösen?</p>
<p>Vielen Dank.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/174430/socket-casyncsocket-in-thread-cwinthread</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 13:28:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/174430.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 26 Feb 2007 20:29:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Socket (CAsyncSocket) in Thread (CWinThread) on Mon, 26 Feb 2007 20:29:01 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Habe eine grosses Problem.</p>
<p>Und zwar starte ich in meiner Applikation ein Thread und in diesem<br />
erstelle ich ein Objekt von CAsyncSocket und setze dieses auf Listen().</p>
<p>Jetzt wenn ich das Programm schliesse, will ich zuerst das Socket schliessen, dann das Thread und anschliessend das ganze Programm.</p>
<p>So sieht es bis jetzt aus:</p>
<pre><code class="language-cpp">void CChatDlg::OnCancel()
{
        // thread schliessen
	delete m_pServerThread;

	// Programm beenden
	PostQuitMessage(0);
}
</code></pre>
<p>Im Destruktor vom Thread &quot;versuche&quot; ich noch das Socket zu schliessen.</p>
<p>Doch wenn ich das Programm ausführe kommt beim Debuggen ein Fehler in Sockcore.cpp Linie 541:</p>
<pre><code class="language-cpp">ASSERT(CAsyncSocket::LookupHandle(hSocket, FALSE) != NULL);
</code></pre>
<p>Diese Meldung kommt immer! Egal ob ich versuche das Socket zu schliessen oder nicht.</p>
<p>Wie muss ich das lösen?</p>
<p>Vielen Dank.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1236021</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1236021</guid><dc:creator><![CDATA[Grosses_Problem]]></dc:creator><pubDate>Mon, 26 Feb 2007 20:29:01 GMT</pubDate></item><item><title><![CDATA[Reply to Socket (CAsyncSocket) in Thread (CWinThread) on Mon, 26 Feb 2007 21:15:22 GMT]]></title><description><![CDATA[<p>Ich weis zwar nicht, ob das dein Problem auslöst, aber warum benutzt du zum Beenden PostQuitMessage(0);?<br />
Rufe an der Stelle doch einfach die Eltern-Methode auf,<br />
also</p>
<pre><code class="language-cpp">CDialog::OnCancel();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1236052</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1236052</guid><dc:creator><![CDATA[Pellaeon]]></dc:creator><pubDate>Mon, 26 Feb 2007 21:15:22 GMT</pubDate></item><item><title><![CDATA[Reply to Socket (CAsyncSocket) in Thread (CWinThread) on Tue, 27 Feb 2007 11:57:22 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Vielen Dank für die Antwort.<br />
Ok werde ich versuche mit der Parent Funktion zum schliessen.<br />
Aber es liegt nicht an diesem Befehl, weil beim debuggen er bei der delete Funktion abbricht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1236147</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1236147</guid><dc:creator><![CDATA[Grosses_Problem]]></dc:creator><pubDate>Tue, 27 Feb 2007 11:57:22 GMT</pubDate></item></channel></rss>