<?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[[VS60] GetQueuedCompletionStatus(): (falsche) Anzahl an übertragenen Bytes]]></title><description><![CDATA[<p>Hallo Zusammen!</p>
<p>Hab da ein Problem, bzw. eher eine Frage zu o.g. Funktion.</p>
<p>Per Definition</p>
<pre><code class="language-cpp">BOOL GetQueuedCompletionStatus(
HANDLE CompletionPort,       // the I/O completion port of interest
LPDWORD lpNumberOfBytesTransferred,
                               // to receive number of bytes 
                               // transferred during I/O
LPDWORD lpCompletionKey,     // to receive file's completion key
LPOVERLAPPED *lpOverlapped,  // to receive pointer to OVERLAPPED 
                               // structure
DWORD dwMilliseconds         // optional timeout value
);
</code></pre>
<p>gibt der Parameter lpNumberOfBytesTransferred die Anzahl der übertragenen Bytes zurück wenn die Funktion zurückkehrt oder das timeout zuschlägt. (Auf die genaue Implementierung der I/O-CompletionPorts einzugehen würd sich glaub ich a bissal ziehen...Nur so viel: klappt wunderbar und das schon einige Zeit.)</p>
<p>Das klappt auch alles wunderbar so lange ich mich im LAN bewege (Server/Client klappt auch einwandfrei). Sobald ich Daten über's Internet verschicke, kommt es ab und an (ja, ich hab noch nicht rausbekommen an was es genau liegt) vor, das die Methode mit nur einem Teil der Bytes (ca. 60%) zurückkehrt. Mit dem nächsten Completion der Rest der Daten.</p>
<p>Auf der Gegenseite (Sender) hab ich bereits sichergestellt, dass auch immer die komplette Datenmenge auf die Reise geschickt wird. Anhand eines Parameter im Paket kann ich feststellen, ob noch was fehlt oder ob schon alles angekommen ist und reagiere dementsprechend. (Sollte aber eigentlich nicht passieren, da TCP[/IP] das eigentlich regelt.)</p>
<p>Die Frage ist daher nicht, wie ich es erreiche, dass nur die komplette Anzahl der Daten bearbeitet wird, sondern warum das Ding völlig irrational in ca. 90% der Fälle mit den kompletten Daten aufwacht und manchmal nur mit einem Teil.</p>
<p>Hat wer eine Ahnung/Tip?</p>
<p>Grüße,<br />
m.</p>
<p>PS: Datengröße ist 4k, TCP[/IP] macht das aber wie es soll. Zerfetzen und wieder zusammenbauen.<br />
PPS: Ein Code-BSP muss glaub ich ned sein, is fast identisch mit einschlägigen Win-BSPs.<br />
PPPS: Hätte das eher in WinAPI rein sollen? Dann entschuldige ich mich jetzt schon.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/199796/vs60-getqueuedcompletionstatus-falsche-anzahl-an-übertragenen-bytes</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 21:58:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/199796.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 07 Dec 2007 09:49:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [VS60] GetQueuedCompletionStatus(): (falsche) Anzahl an übertragenen Bytes on Fri, 07 Dec 2007 09:49:36 GMT]]></title><description><![CDATA[<p>Hallo Zusammen!</p>
<p>Hab da ein Problem, bzw. eher eine Frage zu o.g. Funktion.</p>
<p>Per Definition</p>
<pre><code class="language-cpp">BOOL GetQueuedCompletionStatus(
HANDLE CompletionPort,       // the I/O completion port of interest
LPDWORD lpNumberOfBytesTransferred,
                               // to receive number of bytes 
                               // transferred during I/O
LPDWORD lpCompletionKey,     // to receive file's completion key
LPOVERLAPPED *lpOverlapped,  // to receive pointer to OVERLAPPED 
                               // structure
DWORD dwMilliseconds         // optional timeout value
);
</code></pre>
<p>gibt der Parameter lpNumberOfBytesTransferred die Anzahl der übertragenen Bytes zurück wenn die Funktion zurückkehrt oder das timeout zuschlägt. (Auf die genaue Implementierung der I/O-CompletionPorts einzugehen würd sich glaub ich a bissal ziehen...Nur so viel: klappt wunderbar und das schon einige Zeit.)</p>
<p>Das klappt auch alles wunderbar so lange ich mich im LAN bewege (Server/Client klappt auch einwandfrei). Sobald ich Daten über's Internet verschicke, kommt es ab und an (ja, ich hab noch nicht rausbekommen an was es genau liegt) vor, das die Methode mit nur einem Teil der Bytes (ca. 60%) zurückkehrt. Mit dem nächsten Completion der Rest der Daten.</p>
<p>Auf der Gegenseite (Sender) hab ich bereits sichergestellt, dass auch immer die komplette Datenmenge auf die Reise geschickt wird. Anhand eines Parameter im Paket kann ich feststellen, ob noch was fehlt oder ob schon alles angekommen ist und reagiere dementsprechend. (Sollte aber eigentlich nicht passieren, da TCP[/IP] das eigentlich regelt.)</p>
<p>Die Frage ist daher nicht, wie ich es erreiche, dass nur die komplette Anzahl der Daten bearbeitet wird, sondern warum das Ding völlig irrational in ca. 90% der Fälle mit den kompletten Daten aufwacht und manchmal nur mit einem Teil.</p>
<p>Hat wer eine Ahnung/Tip?</p>
<p>Grüße,<br />
m.</p>
<p>PS: Datengröße ist 4k, TCP[/IP] macht das aber wie es soll. Zerfetzen und wieder zusammenbauen.<br />
PPS: Ein Code-BSP muss glaub ich ned sein, is fast identisch mit einschlägigen Win-BSPs.<br />
PPPS: Hätte das eher in WinAPI rein sollen? Dann entschuldige ich mich jetzt schon.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416349</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416349</guid><dc:creator><![CDATA[m.trix]]></dc:creator><pubDate>Fri, 07 Dec 2007 09:49:36 GMT</pubDate></item><item><title><![CDATA[Reply to [VS60] GetQueuedCompletionStatus(): (falsche) Anzahl an übertragenen Bytes on Fri, 07 Dec 2007 10:32:52 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-18038.html" rel="nofollow">CStoll</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-1.html" rel="nofollow">MFC (Visual C++)</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-4.html" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" 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/1416382</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416382</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Fri, 07 Dec 2007 10:32:52 GMT</pubDate></item><item><title><![CDATA[Reply to [VS60] GetQueuedCompletionStatus(): (falsche) Anzahl an übertragenen Bytes on Fri, 07 Dec 2007 10:36:04 GMT]]></title><description><![CDATA[<p>Was für einen Wert hast du denn als Timeout angegeben? Vielleicht hat die Übertragung der Daten einfach zu lange gedauert und irgendwo in der Mitte hat die Funktion wegen TimeOut abgebrochen.</p>
<p>m.trix schrieb:</p>
<blockquote>
<p>PPPS: Hätte das eher in WinAPI rein sollen? Dann entschuldige ich mich jetzt schon.</p>
</blockquote>
<p>Kein Problem - das lässt sich mit ein paar Mausklicks beheben <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416384</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416384</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 07 Dec 2007 10:36:04 GMT</pubDate></item><item><title><![CDATA[Reply to [VS60] GetQueuedCompletionStatus(): (falsche) Anzahl an übertragenen Bytes on Fri, 07 Dec 2007 11:04:21 GMT]]></title><description><![CDATA[<p>Dann hat mich meine Vermutung mit WinAPI also doch nicht getäuscht. Sollte öfter mal auf mich hören. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Timeout is auf INFINITE gesetzt. Aber ich denkmal das man das ausschließen kann. Hab zwar kein fibre backbone, aber schnell genug isses allemal. Zum mal der Rest der Daten unmittelbar mit dem nächsten Completion kommt.</p>
<p>Hab auch schon sämtliche Daten-Puffer überprüft ob da irgendwo der Hund drin ist. Aber die Größen passen alle. Die Methode kommt aus irgendeinem Grund nur mit einem Teil der Daten aus dem 'Winterschlaf'.</p>
<p>Wie schon gesagt, der gesamte Kommunikations-Apparat ist schon länger in Betrieb und klappt auch ohne Aussetzer. Dieses 'Phänomen' ist im LAN nicht präsent, über Internet mal so, mal so, mal bei dem Paket, mal bei dem. Wenn ich da wenigstens ein Muster erkennen könnte...</p>
<p>Danke schonmal für<br />
a) die freundliche Zurechtweisung.<br />
b) deinen Tip.</p>
<p>Grüße,<br />
m.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416411</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416411</guid><dc:creator><![CDATA[m.trix]]></dc:creator><pubDate>Fri, 07 Dec 2007 11:04:21 GMT</pubDate></item><item><title><![CDATA[Reply to [VS60] GetQueuedCompletionStatus(): (falsche) Anzahl an übertragenen Bytes on Fri, 07 Dec 2007 12:42:30 GMT]]></title><description><![CDATA[<p>Das ist bei TCP völlig normal und lässt sich auch nicht ändern.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416476</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416476</guid><dc:creator><![CDATA[...........]]></dc:creator><pubDate>Fri, 07 Dec 2007 12:42:30 GMT</pubDate></item><item><title><![CDATA[Reply to [VS60] GetQueuedCompletionStatus(): (falsche) Anzahl an übertragenen Bytes on Fri, 07 Dec 2007 14:14:28 GMT]]></title><description><![CDATA[<p>Hab auch in keinster Weise daran gezweifelt.</p>
<blockquote>
<p>Datengröße ist 4k, TCP[/IP] macht das aber wie es soll. Zerfetzen und wieder zusammenbauen.</p>
</blockquote>
<p>Dafür gibt's ja verbindungsorientierte Protokolle.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416557</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416557</guid><dc:creator><![CDATA[m.trix]]></dc:creator><pubDate>Fri, 07 Dec 2007 14:14:28 GMT</pubDate></item><item><title><![CDATA[Reply to [VS60] GetQueuedCompletionStatus(): (falsche) Anzahl an übertragenen Bytes on Fri, 07 Dec 2007 14:45:54 GMT]]></title><description><![CDATA[<p>Verbindungsorientieter Protokolle sichern die *Verbindung*.<br />
Die Daten kommen damit *zuverlässig* an.</p>
<p>ABER: Wenn Du z.B: 1000 Bytes wegschickst, dann kann auf der Empfängerseite folgendes ankommen, 1 Byte, 9 Byte, 90 Byte, 500 Byte, 400 Byte</p>
<p>Es kommen also auch 1000 Bytes an, aber eben in Häppchen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416570</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416570</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Fri, 07 Dec 2007 14:45:54 GMT</pubDate></item><item><title><![CDATA[Reply to [VS60] GetQueuedCompletionStatus(): (falsche) Anzahl an übertragenen Bytes on Fri, 07 Dec 2007 17:01:20 GMT]]></title><description><![CDATA[<p>m.trix schrieb:</p>
<blockquote>
<p>Hab auch in keinster Weise daran gezweifelt.</p>
</blockquote>
<p>Hä? Warum hast du dann diesen Thread erstellt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416654</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416654</guid><dc:creator><![CDATA[........]]></dc:creator><pubDate>Fri, 07 Dec 2007 17:01:20 GMT</pubDate></item><item><title><![CDATA[Reply to [VS60] GetQueuedCompletionStatus(): (falsche) Anzahl an übertragenen Bytes on Fri, 07 Dec 2007 17:40:43 GMT]]></title><description><![CDATA[<p>Weil ich die irrsinnige Vermutung habe/hatte, dass die o.g. Funktion erst zurückkehrt, wenn alle Bytes komplett übertragen sind.</p>
<p>Scheint aber nicht der Fall zu sein.</p>
<p>Grüße,<br />
m.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416688</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416688</guid><dc:creator><![CDATA[m.trix]]></dc:creator><pubDate>Fri, 07 Dec 2007 17:40:43 GMT</pubDate></item><item><title><![CDATA[Reply to [VS60] GetQueuedCompletionStatus(): (falsche) Anzahl an übertragenen Bytes on Fri, 07 Dec 2007 18:17:12 GMT]]></title><description><![CDATA[<p>is auch schlecht dokumentiert</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416708</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416708</guid><dc:creator><![CDATA[eeky]]></dc:creator><pubDate>Fri, 07 Dec 2007 18:17:12 GMT</pubDate></item><item><title><![CDATA[Reply to [VS60] GetQueuedCompletionStatus(): (falsche) Anzahl an übertragenen Bytes on Fri, 07 Dec 2007 18:24:17 GMT]]></title><description><![CDATA[<p>Nö.</p>
<p>recv:</p>
<p>For connection-oriented sockets (type SOCK_STREAM for example), calling recv will return as much data as is currently available—up to the size of the buffer specified.</p>
<p>WSARecv:<br />
For byte stream-style sockets (for example, type SOCK_STREAM), incoming data is placed into the buffers until the buffers are filled, the connection is closed, or the <strong>internally buffered data is exhausted</strong>. Regardless of whether or not the incoming data fills all the buffers, the completion indication occurs for overlapped sockets.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416713</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416713</guid><dc:creator><![CDATA[-.-]]></dc:creator><pubDate>Fri, 07 Dec 2007 18:24:17 GMT</pubDate></item><item><title><![CDATA[Reply to [VS60] GetQueuedCompletionStatus(): (falsche) Anzahl an übertragenen Bytes on Sat, 08 Dec 2007 09:09:52 GMT]]></title><description><![CDATA[<p>Ok, ok. Dann hat sich das jetzt von selbst erklärt. Mal wieder einfach drübergelesen. Danke für die Hilfe!</p>
<p>Aber nochwas, da ich da vllt. auch im Dunkeln tappe oder im Studium mal wieder geschlafen hab:<br />
Wenn TCP mein 1000 Byte auseinanderreisst, dann kann ich schon davon augehen, dass ich mich nicht noch um die Reihenfolge kümmern muss? Die Bytes sind dann schon in der ursprünglichen Reihenfolge?</p>
<p>Grüße,<br />
m.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416908</guid><dc:creator><![CDATA[m.trix]]></dc:creator><pubDate>Sat, 08 Dec 2007 09:09:52 GMT</pubDate></item><item><title><![CDATA[Reply to [VS60] GetQueuedCompletionStatus(): (falsche) Anzahl an übertragenen Bytes on Sat, 08 Dec 2007 16:23:45 GMT]]></title><description><![CDATA[<p><a href="http://de.wikipedia.org/wiki/Transmission_Control_Protocol#Datenintegrit.C3.A4t_und_Zuverl.C3.A4ssigkeit" rel="nofollow">http://de.wikipedia.org/wiki/Transmission_Control_Protocol#Datenintegrit.C3.A4t_und_Zuverl.C3.A4ssigkeit</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1417112</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1417112</guid><dc:creator><![CDATA[o.O]]></dc:creator><pubDate>Sat, 08 Dec 2007 16:23:45 GMT</pubDate></item></channel></rss>