<?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[FTP Problem]]></title><description><![CDATA[<p>Hallo!</p>
<p>Habe ein kleines Problem und zwar, habe ich mir meinen FTP Server zusammengebastelt, der Code sieht so aus:</p>
<pre><code>#include &lt;cstdlib&gt;
#include &lt;iostream&gt;
#include &lt;winsock.h&gt;
#include &lt;winsock2.h&gt;
#include &lt;windows.h&gt;

using namespace std;

int gPort = 21;
int error = 0;
string msg = &quot;USER DarthVader&quot;;
string msp = &quot;PASS starwarsrulez&quot;;
string dir = &quot;dir&quot;;
string help = &quot;help&quot;;
string helo = &quot;helo&quot;;

int main(int)
{
       SOCKET lhSocket;
       SOCKADDR_IN lSockAddr;
       WSADATA wsaData;
       int lConnect;
       int lLength;
       char lData[]=&quot;SendData&quot;;
       if(WSAStartup(MAKEWORD(2,0),&amp;wsaData) != 0)
       {
            cout&lt;&lt;&quot;Socket Initialization Error. Program aborted\n&quot;;
            cin&gt;&gt;error;
            return 0;
        }
       lhSocket = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
       if(lhSocket == INVALID_SOCKET)
       {
            cout&lt;&lt;&quot;Invalid Socket &quot;&lt;&lt;GetLastError()&lt;&lt;&quot;. Program Aborted\n&quot;&lt;&lt;endl;
            cin&gt;&gt;error;
        }
       memset(&amp;lSockAddr,0, sizeof(lSockAddr));
       lSockAddr.sin_family = AF_INET;
       lSockAddr.sin_port = htons(gPort);
       lSockAddr.sin_addr.s_addr = inet_addr(&quot;127.0.0.1&quot;);
       lConnect = connect(lhSocket,(SOCKADDR *)&amp;lSockAddr,sizeof(SOCKADDR_IN));
       if(lConnect != 0)
       {
             cout&lt;&lt;&quot;Connect Error. Program aborted\n&quot;;
             cin&gt;&gt;error;
             return 0;
       }

      //Sag dem Server hallo weil wir so nett sind :-)
      send(lhSocket, helo.c_str(),strlen(helo.c_str()),0);
      Sleep(2000);

      char temp[512];
      int bytes = 0;
      while (bytes == 0)
      {
             bytes = recv(lhSocket,temp,sizeof(temp)-1,0);
             temp[bytes] = '\0';
             cout&lt;&lt;temp;   
      }
      Sleep(1000);
      send(lhSocket, msg.c_str(),strlen(msg.c_str()),0);
      Sleep(1000);
      send(lhSocket, msp.c_str(),strlen(msp.c_str()),0);

      int bytes2;
      while (true)
      {
             bytes2 = recv(lhSocket,temp,sizeof(temp)-1,0);
             temp[bytes] = '\0';
             cout&lt;&lt;temp;
      }
      cin&gt;&gt;bytes;

       closesocket(lhSocket);
       return 0;

}
</code></pre>
<p>Habe einen FTP Server local laufen und Benutzername und Passwort stimmen eben mit den obigen überein.<br />
Wenn ich das Programm ausführe steht aber nur:</p>
<blockquote>
<p>220 StarWars III</p>
</blockquote>
<p>Das bedeutet doch, dass ich nicht beim Server eingeloggt bin, denn wenn ich es mit Telnet versuche bekomme ich, wenn ich eingeloggt bin folgende Meldung:</p>
<blockquote>
<p>230 User DarthVader logged in.</p>
</blockquote>
<p>Wo liegt mein Fehler?<br />
Was mache ich, wo wie falsch?</p>
<p>Danke schonmals für die Hilfe!<br />
lg thomas</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/158244/ftp-problem</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 01:13:00 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/158244.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 03 Sep 2006 12:44:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to FTP Problem on Sun, 03 Sep 2006 12:44:05 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Habe ein kleines Problem und zwar, habe ich mir meinen FTP Server zusammengebastelt, der Code sieht so aus:</p>
<pre><code>#include &lt;cstdlib&gt;
#include &lt;iostream&gt;
#include &lt;winsock.h&gt;
#include &lt;winsock2.h&gt;
#include &lt;windows.h&gt;

using namespace std;

int gPort = 21;
int error = 0;
string msg = &quot;USER DarthVader&quot;;
string msp = &quot;PASS starwarsrulez&quot;;
string dir = &quot;dir&quot;;
string help = &quot;help&quot;;
string helo = &quot;helo&quot;;

int main(int)
{
       SOCKET lhSocket;
       SOCKADDR_IN lSockAddr;
       WSADATA wsaData;
       int lConnect;
       int lLength;
       char lData[]=&quot;SendData&quot;;
       if(WSAStartup(MAKEWORD(2,0),&amp;wsaData) != 0)
       {
            cout&lt;&lt;&quot;Socket Initialization Error. Program aborted\n&quot;;
            cin&gt;&gt;error;
            return 0;
        }
       lhSocket = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
       if(lhSocket == INVALID_SOCKET)
       {
            cout&lt;&lt;&quot;Invalid Socket &quot;&lt;&lt;GetLastError()&lt;&lt;&quot;. Program Aborted\n&quot;&lt;&lt;endl;
            cin&gt;&gt;error;
        }
       memset(&amp;lSockAddr,0, sizeof(lSockAddr));
       lSockAddr.sin_family = AF_INET;
       lSockAddr.sin_port = htons(gPort);
       lSockAddr.sin_addr.s_addr = inet_addr(&quot;127.0.0.1&quot;);
       lConnect = connect(lhSocket,(SOCKADDR *)&amp;lSockAddr,sizeof(SOCKADDR_IN));
       if(lConnect != 0)
       {
             cout&lt;&lt;&quot;Connect Error. Program aborted\n&quot;;
             cin&gt;&gt;error;
             return 0;
       }

      //Sag dem Server hallo weil wir so nett sind :-)
      send(lhSocket, helo.c_str(),strlen(helo.c_str()),0);
      Sleep(2000);

      char temp[512];
      int bytes = 0;
      while (bytes == 0)
      {
             bytes = recv(lhSocket,temp,sizeof(temp)-1,0);
             temp[bytes] = '\0';
             cout&lt;&lt;temp;   
      }
      Sleep(1000);
      send(lhSocket, msg.c_str(),strlen(msg.c_str()),0);
      Sleep(1000);
      send(lhSocket, msp.c_str(),strlen(msp.c_str()),0);

      int bytes2;
      while (true)
      {
             bytes2 = recv(lhSocket,temp,sizeof(temp)-1,0);
             temp[bytes] = '\0';
             cout&lt;&lt;temp;
      }
      cin&gt;&gt;bytes;

       closesocket(lhSocket);
       return 0;

}
</code></pre>
<p>Habe einen FTP Server local laufen und Benutzername und Passwort stimmen eben mit den obigen überein.<br />
Wenn ich das Programm ausführe steht aber nur:</p>
<blockquote>
<p>220 StarWars III</p>
</blockquote>
<p>Das bedeutet doch, dass ich nicht beim Server eingeloggt bin, denn wenn ich es mit Telnet versuche bekomme ich, wenn ich eingeloggt bin folgende Meldung:</p>
<blockquote>
<p>230 User DarthVader logged in.</p>
</blockquote>
<p>Wo liegt mein Fehler?<br />
Was mache ich, wo wie falsch?</p>
<p>Danke schonmals für die Hilfe!<br />
lg thomas</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1130144</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1130144</guid><dc:creator><![CDATA[ftpuser]]></dc:creator><pubDate>Sun, 03 Sep 2006 12:44:05 GMT</pubDate></item><item><title><![CDATA[Reply to FTP Problem on Mon, 04 Sep 2006 02:45:44 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=403" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1130506</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1130506</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Mon, 04 Sep 2006 02:45:44 GMT</pubDate></item><item><title><![CDATA[Reply to FTP Problem on Mon, 04 Sep 2006 16:44:18 GMT]]></title><description><![CDATA[<p>Doppelpost ?<br />
Weiter gehts hier: <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-158222.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-158222.html</a></p>
<p>(btw. du hast diesmal &quot;FTP Server&quot; mit &quot;FTP Client&quot; vertauscht ;D)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1130934</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1130934</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Mon, 04 Sep 2006 16:44:18 GMT</pubDate></item></channel></rss>