[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: How to move large data inside a protocol over tcp using Qt/KDE?
From:       "Friedrich W. H. Kossebau" <kossebau () kde ! org>
Date:       2008-09-19 10:57:14
Message-ID: 200809191257.14924.kossebau () kde ! org
[Download RAW message or body]

Am Freitag, 19. September 2008, um 05:51 Uhr, schrieb Matthew Woehlke:
> Probably Qt polls the socket for you as part of the event loop, hence
> the readyRead signal. Assuming Qt supports non-blocking sockets (which
> it *really* should), you just keep trying to read until you get less
> bytes back than you asked for. Normally you take the little buffers and
> use them to progressively fill a larger buffer until you have an entire
> "message".

Which means another copy of the data, next to the buffer and the target data 
structure... :/ I want to do it perfect :)

> At that point, you deal with the message, do a memmove to 
> shift the buffer contents back to the beginning, and repeat until you
> have reason to stop.

So far I could follow, but what is that memmove needed for? Which buffer do 
you mean here?

> Hopefully something in the above makes sense :-) and perhaps will cause
> the examples to make more sense.

Thanks, completes some part of the puzzle for me. :)

Friedrich
-- 
Okteta - KDE 4 Hex Editor - http://utils.kde.org/projects/okteta
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic