<?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[TFTP Download (cURL)]]></title><description><![CDATA[<p>Guten Tag,<br />
ich habe folgendes Problem:</p>
<p>Ich möchte die Datei &quot;test.txt&quot; auf dem TFTP-Server &quot;192.168.0.2&quot; runterladen und wiederrum als &quot;test.txt&quot; speichern.</p>
<pre><code class="language-cpp">#include &lt;QtCore/QCoreApplication&gt;
#include &quot;curl.h&quot;
#include &lt;QDebug&gt;

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    CURL *curl;
    CURLcode res;

    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_TFTP_BLKSIZE,
                        512);
      curl_easy_setopt(curl, CURLOPT_URL,
                       &quot;tftp://192.168.0.2/test.txt&quot;);

      FILE *file = fopen(&quot;test.txt&quot;, &quot;w&quot;);
      if(!file)
        return -1;

      curl_easy_setopt(curl, CURLOPT_WRITEDATA, file);

      curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);

      res = curl_easy_perform(curl);
      curl_easy_cleanup(curl);
   }
}
</code></pre>
<p>Ich erhalte folgende Ausgabe:</p>
<pre><code>* About to connect() to 192.168.0.2 port 69 (#0)
*   Trying 192.168.0.2... * connected
* getpeername() failed with errno 10057: Socket is not connected
* Connected to 192.168.0.2 (192.168.0.2) port 69 (#0)
* set timeouts for state 0; Total 300, retry 6 maxtry 50
</code></pre>
<p>Leider gibt es für eine TFTP-Datenübertragung via. cURL-Library keine Examples bzw. Dokumentationen.<br />
Könnt ihr mir vielleicht weiterhelfen?</p>
<p>Vielen Dank schonmal für eure Beiträge</p>
<p>LG,<br />
weilay</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/286239/tftp-download-curl</link><generator>RSS for Node</generator><lastBuildDate>Fri, 21 Aug 2026 00:50:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/286239.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 06 May 2011 09:42:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to TFTP Download (cURL) on Fri, 06 May 2011 09:42:04 GMT]]></title><description><![CDATA[<p>Guten Tag,<br />
ich habe folgendes Problem:</p>
<p>Ich möchte die Datei &quot;test.txt&quot; auf dem TFTP-Server &quot;192.168.0.2&quot; runterladen und wiederrum als &quot;test.txt&quot; speichern.</p>
<pre><code class="language-cpp">#include &lt;QtCore/QCoreApplication&gt;
#include &quot;curl.h&quot;
#include &lt;QDebug&gt;

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    CURL *curl;
    CURLcode res;

    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_TFTP_BLKSIZE,
                        512);
      curl_easy_setopt(curl, CURLOPT_URL,
                       &quot;tftp://192.168.0.2/test.txt&quot;);

      FILE *file = fopen(&quot;test.txt&quot;, &quot;w&quot;);
      if(!file)
        return -1;

      curl_easy_setopt(curl, CURLOPT_WRITEDATA, file);

      curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);

      res = curl_easy_perform(curl);
      curl_easy_cleanup(curl);
   }
}
</code></pre>
<p>Ich erhalte folgende Ausgabe:</p>
<pre><code>* About to connect() to 192.168.0.2 port 69 (#0)
*   Trying 192.168.0.2... * connected
* getpeername() failed with errno 10057: Socket is not connected
* Connected to 192.168.0.2 (192.168.0.2) port 69 (#0)
* set timeouts for state 0; Total 300, retry 6 maxtry 50
</code></pre>
<p>Leider gibt es für eine TFTP-Datenübertragung via. cURL-Library keine Examples bzw. Dokumentationen.<br />
Könnt ihr mir vielleicht weiterhelfen?</p>
<p>Vielen Dank schonmal für eure Beiträge</p>
<p>LG,<br />
weilay</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2059403</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2059403</guid><dc:creator><![CDATA[weilay]]></dc:creator><pubDate>Fri, 06 May 2011 09:42:04 GMT</pubDate></item></channel></rss>