<?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[Probleme mit Exceptionhandling]]></title><description><![CDATA[<p>Ich nutze Indy 9.<br />
Ich habe einen TCPServer und einen TCPClient.<br />
Vom Server aus disconnecte ich den Client.<br />
Beim Client kommt dann die Exception &quot;Connection Closed Gracefully&quot;.<br />
Hat einer eine Idee wie ich das Abfangen kann?<br />
Mit try und catch kann ich nichts anfangen, da die Exception vom Client kommt.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/183190/probleme-mit-exceptionhandling</link><generator>RSS for Node</generator><lastBuildDate>Sat, 15 Aug 2026 22:52:49 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/183190.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 02 Jun 2007 16:30:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme mit Exceptionhandling on Sat, 02 Jun 2007 16:30:42 GMT]]></title><description><![CDATA[<p>Ich nutze Indy 9.<br />
Ich habe einen TCPServer und einen TCPClient.<br />
Vom Server aus disconnecte ich den Client.<br />
Beim Client kommt dann die Exception &quot;Connection Closed Gracefully&quot;.<br />
Hat einer eine Idee wie ich das Abfangen kann?<br />
Mit try und catch kann ich nichts anfangen, da die Exception vom Client kommt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297231</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297231</guid><dc:creator><![CDATA[Tobi3000]]></dc:creator><pubDate>Sat, 02 Jun 2007 16:30:42 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Exceptionhandling on Sat, 02 Jun 2007 16:52:20 GMT]]></title><description><![CDATA[<p>Zu beachten ist, dass im Builder grundsätzlich alle Fehler angezeigt werden. Mit try/catch kann man diese nicht unterdrücken. Starte die Anwendung mal direkt, also nicht aus dem Builder heraus. Dann sollte es funktionieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297251</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297251</guid><dc:creator><![CDATA[Rostfrei**]]></dc:creator><pubDate>Sat, 02 Jun 2007 16:52:20 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Exceptionhandling on Sat, 02 Jun 2007 16:55:50 GMT]]></title><description><![CDATA[<p>Tut mir leid, ich habe vergessen zu sagen, dass ich es außerhalb der IDE gestartet habe.</p>
<p>Das Problem kommt also immer.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297252</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297252</guid><dc:creator><![CDATA[Tobi3000]]></dc:creator><pubDate>Sat, 02 Jun 2007 16:55:50 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Exceptionhandling on Sat, 02 Jun 2007 17:02:04 GMT]]></title><description><![CDATA[<p>// Edit</p>
<p>Poste mal relevanten Code. Normalerweise sollte es funktionieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297253</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297253</guid><dc:creator><![CDATA[Rostfrei**]]></dc:creator><pubDate>Sat, 02 Jun 2007 17:02:04 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Exceptionhandling on Sat, 02 Jun 2007 17:08:33 GMT]]></title><description><![CDATA[<p>Ich les mir grad den relevanten Code durch und merke, dass da wirklich was nicht stimmt.</p>
<p>Ich habe da heute Mittag was rausgestrichen, was ich später wieder einfädeln wollte und ich habs vergessen.</p>
<p>Muss den Code nochmal überarbeiten, der ist doch recht kompliziert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297255</guid><dc:creator><![CDATA[Tobi3000]]></dc:creator><pubDate>Sat, 02 Jun 2007 17:08:33 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Exceptionhandling on Sat, 02 Jun 2007 17:57:17 GMT]]></title><description><![CDATA[<p>OK, Ich hab jetzt alles eingefädelt.</p>
<p>Die Exception kommt allerdings immernoch.</p>
<p>Hier ist der Code:</p>
<p>Der Code soll so etwas wie ein Serverneustart sein.</p>
<pre><code class="language-cpp">void __fastcall TClientList::Reset(void)
{
  TClientChannel* ActChannel = ChStart;

  while(ActChannel-&gt;GetNachfolger())
  {
    ActChannel = ActChannel-&gt;GetNachfolger();
    ActChannel-&gt;GetVorgaenger()-&gt;Reset();
    delete ActChannel-&gt;GetVorgaenger();
  }

  ActChannel-&gt;Reset();
  delete ActChannel;

  ChStart = 0;
  ChEnde = 0;

  Server-&gt;TCPServer-&gt;Active = false;
  Server-&gt;TCPServer-&gt;Active = true;
}
</code></pre>
<p>Der Code aus dem Channel:</p>
<pre><code class="language-cpp">void __fastcall TClientChannel::Reset(void)
{
  TClient* ActClient = Start;
  while(ActClient)
  {
    ActClient-&gt;Reset();
    ActClient = ActClient-&gt;GetNachfolger();
  }
}
</code></pre>
<p>Und dann der von den Einzelnen Clients:</p>
<pre><code class="language-cpp">void __fastcall TClient::Reset(void)
{
  Client-&gt;Data = 0;  //TIdPeerThread* Client;
  Client-&gt;Connection-&gt;DisconnectSocket();
  Client = 0;
}
</code></pre>
<p>In den TClientChannel-Destruktoren werden entsprechend die TClient Objekte gelöscht, wo die Threadadressen gespeichert waren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297277</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297277</guid><dc:creator><![CDATA[Tobi3000]]></dc:creator><pubDate>Sat, 02 Jun 2007 17:57:17 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Exceptionhandling on Sat, 02 Jun 2007 18:05:43 GMT]]></title><description><![CDATA[<p>Ja und wo ist Deine try/catch - Kapselung? Alternativ kannst Du es auch mit dem Event OnException der ApplicationEvents-Komponente probieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297287</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297287</guid><dc:creator><![CDATA[Rostfrei**]]></dc:creator><pubDate>Sat, 02 Jun 2007 18:05:43 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Exceptionhandling on Sat, 02 Jun 2007 18:16:44 GMT]]></title><description><![CDATA[<p>Genau aus diesem Grund hab ich diesen Thread ja eröffnet.</p>
<p>Das ist der Code auf der Seite des Servers.<br />
Die Exception kommt allerdings vom Client.</p>
<p>Wo soll ich jetzt beim Client eine Try/Catch hinsetzen um das abzufangen?</p>
<p>Die Sache mit dem OnException werd ich mir gleich mal angucken.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297296</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297296</guid><dc:creator><![CDATA[Tobi3000]]></dc:creator><pubDate>Sat, 02 Jun 2007 18:16:44 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Exceptionhandling on Sat, 02 Jun 2007 18:53:46 GMT]]></title><description><![CDATA[<p>Alles klar!</p>
<p>Ich habe das jetzt so gelöst, wie es in der Hilfe geschrieben steht.</p>
<pre><code class="language-cpp">void __fastcall TClient::AppException(TObject *Sender,Exception *E)
{
  if(!E-&gt;Message.Pos(&quot;Connection Closed Gracefully&quot;))
  {
    Application-&gt;ShowException(E);
    Application-&gt;Terminate();
  }
}
</code></pre>
<pre><code class="language-cpp">Application-&gt;OnException = AppException;
</code></pre>
<p>Jetzt funktioniert es.</p>
<p>Danke für die Hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297328</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297328</guid><dc:creator><![CDATA[Tobi3000]]></dc:creator><pubDate>Sat, 02 Jun 2007 18:53:46 GMT</pubDate></item></channel></rss>