diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-04-13 18:04:00 +0100 |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-05-11 16:37:23 +0200 |
commit | fe5613123685cf3db61484f5a43cfae3154d5f6f (patch) | |
tree | 248596f98f6907964baae92a82cf160d3aff0779 /src/network/socket/qsymbiansocketengine_p.h | |
parent | 7d505004f50d4dc75f358892069c7d6e7548336e (diff) |
Optimisation - buffer packet read in pendingDatagramSize
In Symbian, the OS function to get the size of a pending datagram also
includes the size of the packet header (which is different for IPv4 and
IPv6). We were reading the datagram with the "peek" flag set to
implement pendingDatagramSize, then reading again normally when the
client called read/readDatagram.
This change removes the "peek" flag, and buffers the datagram in the
socket engine, returning it and clearing the buffer when read or
readDatagram is called.
If there is no buffered data, the existing code path is followed - it
isn't mandatory to call pendingDatagramSize before reading from the
socket.
Reviewed-by: Markus Goetz
(cherry picked from commit dd8de4c2437397748daba49569cbc7f89a8bfbee)
Diffstat (limited to 'src/network/socket/qsymbiansocketengine_p.h')
-rw-r--r-- | src/network/socket/qsymbiansocketengine_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network/socket/qsymbiansocketengine_p.h b/src/network/socket/qsymbiansocketengine_p.h index 85ab54af12..2e7c155f3a 100644 --- a/src/network/socket/qsymbiansocketengine_p.h +++ b/src/network/socket/qsymbiansocketengine_p.h @@ -196,6 +196,8 @@ public: bool exceptNotificationsEnabled; QAsyncSelect* asyncSelect; + mutable QByteArray receivedDataBuffer; + mutable bool hasReceivedBufferedDatagram; // FIXME this is duplicated from qnativesocketengine_p.h enum ErrorString { NonBlockingInitFailedErrorString, |