<?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[Typumwandlung]]></title><description><![CDATA[<p>Hallo NG,</p>
<p>ich habe ein paar Netzwerksockets, die ich mit Descriptoren überwache. Nun muß ich ein Dateidescriptor von Typ FILE* mitüberwachen. Aber FSET will ein int haben. Der Inhalt von FILE* ist vom Typ _IO_FILE. Mittlerweile weiß ich, das _IO_FILE ein struct ist. Nun weiß ich auch, das _IO_FILE ein Stream darstellt. Kann ich das überhaupt mit select überwachen?</p>
<p>Also gibt es da überhaupt einen Descriptor?</p>
<p>Ich habs <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":-)"
      alt="🙂"
    /></p>
<pre><code class="language-cpp">fd_set descriptorSet;
int network_1;
...
int network_n;

FILE* important;
int fileDescriptor; //////////////////// So...!!!

network_1 = socket(AF_INET, SOCK_STREAM, 0);
FD_SET(network_1, descriptorSet);
...
network_n = socket(AF_INET, SOCK_STREAM, 0);
FD_SET(network_n, descriptorSet);

important = fopen ( &quot;~/important.file&quot;, &quot;rb&quot; );
fileDescriptor = fileno(important); //////////////////// ...so...!!!
FD_SET(fileDescriptor, descriptorSet); ///////////////////// ...und so!!!
</code></pre>
<p>Gruß M. Incani</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/215624/typumwandlung</link><generator>RSS for Node</generator><lastBuildDate>Mon, 12 Oct 2026 03:15:26 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/215624.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 13 Jun 2008 11:51:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Typumwandlung on Fri, 13 Jun 2008 12:38:35 GMT]]></title><description><![CDATA[<p>Hallo NG,</p>
<p>ich habe ein paar Netzwerksockets, die ich mit Descriptoren überwache. Nun muß ich ein Dateidescriptor von Typ FILE* mitüberwachen. Aber FSET will ein int haben. Der Inhalt von FILE* ist vom Typ _IO_FILE. Mittlerweile weiß ich, das _IO_FILE ein struct ist. Nun weiß ich auch, das _IO_FILE ein Stream darstellt. Kann ich das überhaupt mit select überwachen?</p>
<p>Also gibt es da überhaupt einen Descriptor?</p>
<p>Ich habs <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":-)"
      alt="🙂"
    /></p>
<pre><code class="language-cpp">fd_set descriptorSet;
int network_1;
...
int network_n;

FILE* important;
int fileDescriptor; //////////////////// So...!!!

network_1 = socket(AF_INET, SOCK_STREAM, 0);
FD_SET(network_1, descriptorSet);
...
network_n = socket(AF_INET, SOCK_STREAM, 0);
FD_SET(network_n, descriptorSet);

important = fopen ( &quot;~/important.file&quot;, &quot;rb&quot; );
fileDescriptor = fileno(important); //////////////////// ...so...!!!
FD_SET(fileDescriptor, descriptorSet); ///////////////////// ...und so!!!
</code></pre>
<p>Gruß M. Incani</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1528345</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1528345</guid><dc:creator><![CDATA[BlackPepper]]></dc:creator><pubDate>Fri, 13 Jun 2008 12:38:35 GMT</pubDate></item><item><title><![CDATA[Reply to Typumwandlung on Fri, 13 Jun 2008 12:27:54 GMT]]></title><description><![CDATA[<p>Um ehrlich zu sein verstehe ich deine Frage nicht komplett, da ich die Funktion FD_SET nicht kenne. Anscheinend ist diese die entscheidente Funktion zum überwachen eines Sockets bzw. du möchtest anscheinend Daten übers Netz mittels den Sockets einlesen. Und nun willst du ein File Handle in ein Socket Descriptor unwandeln und ich bin mir nicht sicher ob das C++ unterstützt.</p>
<p>Ich würde alternativ mal schauen ob man die Datei auch mittels eines Sockets öffnen kann. Die Adresse kann sicherlich auch so umbiegen, dass sie auf die gewünschte Datei localhost@./important.file zeigt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1528370</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1528370</guid><dc:creator><![CDATA[Bitte ein Bit]]></dc:creator><pubDate>Fri, 13 Jun 2008 12:27:54 GMT</pubDate></item><item><title><![CDATA[Reply to Typumwandlung on Fri, 13 Jun 2008 12:31:01 GMT]]></title><description><![CDATA[<p>Bitte ein Bit schrieb:</p>
<blockquote>
<p>Um ehrlich zu sein verstehe ich deine Frage nicht komplett, da ich die Funktion FD_SET nicht kenne. Anscheinend ist diese die entscheidente Funktion zum überwachen eines Sockets bzw. du möchtest anscheinend Daten übers Netz mittels den Sockets einlesen. Und nun willst du ein File Handle in ein Socket Descriptor unwandeln und ich bin mir nicht sicher ob das C++ unterstützt.</p>
<p>Ich würde alternativ mal schauen ob man die Datei auch mittels eines Sockets öffnen kann. Die Adresse kann sicherlich auch so umbiegen, dass die auf dei gewünschte Datei localhost@./important.file zeigt.</p>
</blockquote>
<p>So entscheident ist FD_SET nicht, sondern select. FD_SET brauche ich nur um select zu sagen welchen Socket es überwachen soll. Und ich weiß nicht, ob alle Operationen die auf Streams gemacht werden können auch auf Sockets gemacht werden können. Wenn ja, kann ich das ganze auch auf Sockets unstellen.</p>
<p>Gruß,<br />
M. Incani</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1528373</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1528373</guid><dc:creator><![CDATA[BlackPepper]]></dc:creator><pubDate>Fri, 13 Jun 2008 12:31:01 GMT</pubDate></item><item><title><![CDATA[Reply to Typumwandlung on Fri, 13 Jun 2008 14:44:04 GMT]]></title><description><![CDATA[<p>open statt fopen verwenden</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1528458</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1528458</guid><dc:creator><![CDATA[Shade Of Mine]]></dc:creator><pubDate>Fri, 13 Jun 2008 14:44:04 GMT</pubDate></item></channel></rss>