<?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[gethostbyname]]></title><description><![CDATA[<p>Hallo<br />
Ich benutze momentan gethostbyname um herauszufinden ob eine Internetverbindung besteht.</p>
<pre><code class="language-cpp">if(gethostbyname( &quot;www.google.de&quot; ) == NULL)
internet = false;
</code></pre>
<p>Nun wollte ich fragen ob dieser Code oft ein falsches Ergebnis liefert.<br />
Heißt: Kommt es oft vor, dass gethostbyname = NULL ist obwohl eine Internetverbindung besteht und umgekehrt genau so?</p>
<p>Da ich sowieso Glaube, dass diese Methode nicht die Beste ist würde ich mich auch über andere Vorschläge freuen (InternetGetConnectedState funktionieren bei mir nicht. Es gibt immer TRUE zurück.)</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/240870/gethostbyname</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Apr 2026 18:35:43 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/240870.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 12 May 2009 20:09:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to gethostbyname on Tue, 12 May 2009 20:09:46 GMT]]></title><description><![CDATA[<p>Hallo<br />
Ich benutze momentan gethostbyname um herauszufinden ob eine Internetverbindung besteht.</p>
<pre><code class="language-cpp">if(gethostbyname( &quot;www.google.de&quot; ) == NULL)
internet = false;
</code></pre>
<p>Nun wollte ich fragen ob dieser Code oft ein falsches Ergebnis liefert.<br />
Heißt: Kommt es oft vor, dass gethostbyname = NULL ist obwohl eine Internetverbindung besteht und umgekehrt genau so?</p>
<p>Da ich sowieso Glaube, dass diese Methode nicht die Beste ist würde ich mich auch über andere Vorschläge freuen (InternetGetConnectedState funktionieren bei mir nicht. Es gibt immer TRUE zurück.)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1709610</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1709610</guid><dc:creator><![CDATA[Fatal Error appears]]></dc:creator><pubDate>Tue, 12 May 2009 20:09:46 GMT</pubDate></item><item><title><![CDATA[Reply to gethostbyname on Fri, 10 Jul 2009 12:29:08 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">int CheckINETCON ()
{
DWORD dwTemp;
dwTemp = INTERNET_CONNECTION_MODEM | INTERNET_CONNECTION_LAN | INTERNET_CONNECTION_PROXY | INTERNET_CONNECTION_MODEM_BUSY;
int status;

status = InternetGetConnectedState(&amp;dwTemp, 0);

if(status == 1)
{
	return 1;
}
else
{
	return 0;
}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1740385</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1740385</guid><dc:creator><![CDATA[..]]></dc:creator><pubDate>Fri, 10 Jul 2009 12:29:08 GMT</pubDate></item></channel></rss>