<?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[ip ermitteln aus bestehender TCP&#x2F;IP-Verbindung]]></title><description><![CDATA[<p>hi,</p>
<p>wie ermittelt man auf server-seite<br />
die ip nach etablierung einer tcp/ip-verbindung?</p>
<p>thx &amp; gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/71655/ip-ermitteln-aus-bestehender-tcp-ip-verbindung</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 18:47:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/71655.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 20 Apr 2004 14:49:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ip ermitteln aus bestehender TCP&#x2F;IP-Verbindung on Tue, 20 Apr 2004 14:49:53 GMT]]></title><description><![CDATA[<p>hi,</p>
<p>wie ermittelt man auf server-seite<br />
die ip nach etablierung einer tcp/ip-verbindung?</p>
<p>thx &amp; gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/505358</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/505358</guid><dc:creator><![CDATA[_um]]></dc:creator><pubDate>Tue, 20 Apr 2004 14:49:53 GMT</pubDate></item><item><title><![CDATA[Reply to ip ermitteln aus bestehender TCP&#x2F;IP-Verbindung on Tue, 20 Apr 2004 17:11:36 GMT]]></title><description><![CDATA[<p>die eigene ip oder die des remote?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/505478</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/505478</guid><dc:creator><![CDATA[Tanta]]></dc:creator><pubDate>Tue, 20 Apr 2004 17:11:36 GMT</pubDate></item><item><title><![CDATA[Reply to ip ermitteln aus bestehender TCP&#x2F;IP-Verbindung on Tue, 20 Apr 2004 17:18:20 GMT]]></title><description><![CDATA[<p>Wie bzw. womit hast du denn deinen Server programmiert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/505485</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/505485</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Tue, 20 Apr 2004 17:18:20 GMT</pubDate></item><item><title><![CDATA[Reply to ip ermitteln aus bestehender TCP&#x2F;IP-Verbindung on Tue, 20 Apr 2004 19:30:56 GMT]]></title><description><![CDATA[<p>1. beides wär praktisch, aber hauptsächlich gehts mir um die remote-ip</p>
<p>2. geschrieben ist / wird server mit gcc unter linux und der client<br />
mit <a href="http://vc.net" rel="nofollow">vc.net</a>, wobei im moment der server auch noch unter win läuft.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/505576</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/505576</guid><dc:creator><![CDATA[_um]]></dc:creator><pubDate>Tue, 20 Apr 2004 19:30:56 GMT</pubDate></item><item><title><![CDATA[Reply to ip ermitteln aus bestehender TCP&#x2F;IP-Verbindung on Tue, 20 Apr 2004 19:52:39 GMT]]></title><description><![CDATA[<p>getpeername() und getsockname()</p>
]]></description><link>https://www.c-plusplus.net/forum/post/505579</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/505579</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Tue, 20 Apr 2004 19:52:39 GMT</pubDate></item><item><title><![CDATA[Reply to ip ermitteln aus bestehender TCP&#x2F;IP-Verbindung on Tue, 20 Apr 2004 20:22:19 GMT]]></title><description><![CDATA[<p>Ist zwar mit BCB geschrieben, kann man aber leicht nach VC++ portieren</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------
// Funktion GetHostIPAddresses schreibt die IP-Adressen des Rechners als
// Strings im Format xxx.xxx.xxx.xxx in die übergebene TStrings-Instanz.
// Die Funktion gibt die Anzahl der gefundenen IP-Adressen zurück.
// Um nur die Anzahl der IP-Adressen zu ermitteln, kann der Funktion
// im Parameter pslStrings ein NULL-Zeiger übergeben werden.
//
// Aufrufbeispiele:
//
// /* schreiben aller Rechner-IPs in eine ListBox: */
// GetHostIPAdresses(ListBox1-Items)
//
// /* schreiben aller Rechner-IPs in die TStringList pslStrings: */
// GetHostIPAdresses(pslStrings);
//---------------------------------------------------------------------------
int GetHostIPAddresses(TStrings* pslStrings)
{
  if(pslStrings) pslStrings -&gt; Clear();
  WSAData stData;
  char caHostName[255];
  hostent* pstHostEntry = NULL;
  in_addr stInetAddress;
  int ilRetVal = 0;

  // Winsock initialisieren:
  if(WSAStartup(0x0101, &amp;stData) == 0)
  {
    // Hostnamen bestimmen:
    if(gethostname(caHostName, 255)) return 0;
    // Hostinformationen abrufen:
    pstHostEntry = gethostbyname(caHostName);
    if(pstHostEntry == NULL) return 0;

    // IP-Adressen bestimmen:
    for(int ilAddrIndex=0; pstHostEntry-&gt;h_addr_list[ilAddrIndex]; ilAddrIndex++)
    {
      stInetAddress.S_un.S_addr =
        *((DWORD*)pstHostEntry-&gt;h_addr_list[ilAddrIndex]);
      if(pslStrings != NULL)
        pslStrings -&gt; Add(inet_ntoa(stInetAddress));
      ilRetVal++;
    }
  }
  else return 0;
  WSACleanup();
  return ilRetVal;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/505603</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/505603</guid><dc:creator><![CDATA[***]]></dc:creator><pubDate>Tue, 20 Apr 2004 20:22:19 GMT</pubDate></item><item><title><![CDATA[Reply to ip ermitteln aus bestehender TCP&#x2F;IP-Verbindung on Tue, 20 Apr 2004 20:38:29 GMT]]></title><description><![CDATA[<p>danke.!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/505622</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/505622</guid><dc:creator><![CDATA[_um]]></dc:creator><pubDate>Tue, 20 Apr 2004 20:38:29 GMT</pubDate></item></channel></rss>