<?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-Verbindung für Login aufrechterhalten]]></title><description><![CDATA[<p>Ich komm da irgendwie nicht weiter.</p>
<pre><code class="language-cpp">char bb[3000];
      char cc[100];
      WSDATA ws;
      SOCKET s;
      struct sockaddr_in A;
      int ii;

      gg = WSAStartup(0x0101, &amp;ws);
      s = socket(AF_INET, SOCK_STREAM, 0);
      A.sin_family      = AF_INET;
      A.sin_port        = htons(80);
      A.sin_addr.s_addr = inet_addr(&quot;62.104.23.32&quot;);
      connect(s, (struct sockaddr *)&amp;A, sizeof(A));

      strcpy(bb, &quot;POST /login.php3 &quot;);
      /* Keep-Alive: 300 */
      /* Connection: keep-alive */
      /* ... */
      send(s, bb, strlen(bb), 0);

      ii = 1;
      while(ii)
        { ii = recv(s, cc, sizeof(cc), 0);
          /* ... */
        }

      strcpy(bb, &quot;GET /&quot;);
      strcat(bb, Location);
      strcat(bb, Cookie);
      /* Keep-Alive: 300 */
      /* Connection: keep-alive */
      /* ... */
      send(s, bb, strlen(bb), 0);

      // +++ bis hier ist alles ok +++

      // Als Antwort kommt nur noch ii = 0

      ii = 1;
      while(ii)
        { ii = recv(s, cc, sizeof(cc), 0); // &lt;== ii gleich 0, bedeutet:
                                           // &quot;If the connection has been
          /* ... */                        // gracefully closed, the return
                                           // value is zero.&quot;
        }
      closesocket(s);
</code></pre>
<p>Warum reißt die Verbindung ab? Oder ist WSAConnect() die richtige Funktion?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/153912/ip-verbindung-für-login-aufrechterhalten</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Jul 2026 13:37:47 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/153912.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 21 Jul 2006 19:08:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to IP-Verbindung für Login aufrechterhalten on Fri, 21 Jul 2006 19:08:34 GMT]]></title><description><![CDATA[<p>Ich komm da irgendwie nicht weiter.</p>
<pre><code class="language-cpp">char bb[3000];
      char cc[100];
      WSDATA ws;
      SOCKET s;
      struct sockaddr_in A;
      int ii;

      gg = WSAStartup(0x0101, &amp;ws);
      s = socket(AF_INET, SOCK_STREAM, 0);
      A.sin_family      = AF_INET;
      A.sin_port        = htons(80);
      A.sin_addr.s_addr = inet_addr(&quot;62.104.23.32&quot;);
      connect(s, (struct sockaddr *)&amp;A, sizeof(A));

      strcpy(bb, &quot;POST /login.php3 &quot;);
      /* Keep-Alive: 300 */
      /* Connection: keep-alive */
      /* ... */
      send(s, bb, strlen(bb), 0);

      ii = 1;
      while(ii)
        { ii = recv(s, cc, sizeof(cc), 0);
          /* ... */
        }

      strcpy(bb, &quot;GET /&quot;);
      strcat(bb, Location);
      strcat(bb, Cookie);
      /* Keep-Alive: 300 */
      /* Connection: keep-alive */
      /* ... */
      send(s, bb, strlen(bb), 0);

      // +++ bis hier ist alles ok +++

      // Als Antwort kommt nur noch ii = 0

      ii = 1;
      while(ii)
        { ii = recv(s, cc, sizeof(cc), 0); // &lt;== ii gleich 0, bedeutet:
                                           // &quot;If the connection has been
          /* ... */                        // gracefully closed, the return
                                           // value is zero.&quot;
        }
      closesocket(s);
</code></pre>
<p>Warum reißt die Verbindung ab? Oder ist WSAConnect() die richtige Funktion?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102006</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102006</guid><dc:creator><![CDATA[keksekekse]]></dc:creator><pubDate>Fri, 21 Jul 2006 19:08:34 GMT</pubDate></item></channel></rss>