diff options
author | Joerg Bornemann <joerg.bornemann@nokia.com> | 2010-04-12 14:26:19 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@nokia.com> | 2010-04-12 14:29:58 (GMT) |
commit | 9e43ab153dbbe83e1e7e2fb1e9d6815424c4b5f2 (patch) | |
tree | ec4975b2365ad34a8334030abf651319f4f0d150 /src | |
parent | 0f790634c57400f4ddffd36f5e3443c712d1a1c3 (diff) | |
download | Qt-9e43ab153dbbe83e1e7e2fb1e9d6815424c4b5f2.zip Qt-9e43ab153dbbe83e1e7e2fb1e9d6815424c4b5f2.tar.gz Qt-9e43ab153dbbe83e1e7e2fb1e9d6815424c4b5f2.tar.bz2 |
accelerate QWindowsPipeWriter for bigger chunks of data
Don't put pipes into message mode.
This makes it possible to not split data into 2k chunks.
Reviewed-by: ossi
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qwindowspipewriter.cpp | 6 | ||||
-rw-r--r-- | src/network/socket/qlocalserver_win.cpp | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp index 417439f..2fe4424 100644 --- a/src/corelib/io/qwindowspipewriter.cpp +++ b/src/corelib/io/qwindowspipewriter.cpp @@ -128,11 +128,9 @@ void QWindowsPipeWriter::run() overl.OffsetHigh = 0; while ((!quitNow) && totalWritten < maxlen) { DWORD written = 0; - // Write 2k at a time to prevent flooding the pipe. If you - // write too much (4k-8k), the pipe can close - // unexpectedly. if (!WriteFile(writePipe, ptrData + totalWritten, - qMin<int>(2048, maxlen - totalWritten), &written, &overl)) { + maxlen - totalWritten, &written, &overl)) { + if (GetLastError() == 0xE8/*NT_STATUS_INVALID_USER_BUFFER*/) { // give the os a rest msleep(100); diff --git a/src/network/socket/qlocalserver_win.cpp b/src/network/socket/qlocalserver_win.cpp index e820f73..5d2be72 100644 --- a/src/network/socket/qlocalserver_win.cpp +++ b/src/network/socket/qlocalserver_win.cpp @@ -65,8 +65,8 @@ bool QLocalServerPrivate::addListener() listener.handle = CreateNamedPipe( (const wchar_t *)fullServerName.utf16(), // pipe name PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, // read/write access - PIPE_TYPE_MESSAGE | // message type pipe - PIPE_READMODE_MESSAGE | // message-read mode + PIPE_TYPE_BYTE | // byte type pipe + PIPE_READMODE_BYTE | // byte-read mode PIPE_WAIT, // blocking mode PIPE_UNLIMITED_INSTANCES, // max. instances BUFSIZE, // output buffer size |