QLocalSocket: always open outer QIODevice in unbuffered mode
The actual buffering is performed either in the inner socket (Unix), or in the pipeReader (Windows). To avoid unnecessary copying of data between buffers, enforce unbuffered mode for all implementations, which slightly improves read performance. Change-Id: Idb2a09f35823b9945c71231710290be12d9930f7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
This commit is contained in:
parent
3bc976c2bd
commit
6f682d4876
@ -396,6 +396,8 @@ QLocalSocket::QLocalSocket(QObject * parent)
|
||||
: QIODevice(*new QLocalSocketPrivate, parent)
|
||||
{
|
||||
Q_D(QLocalSocket);
|
||||
|
||||
d->readBufferChunkSize = 0; // force QIODevice unbuffered mode
|
||||
d->init();
|
||||
}
|
||||
|
||||
|
@ -357,7 +357,7 @@ void QLocalSocketPrivate::_q_connectToSocket()
|
||||
fullServerName = connectingPathName;
|
||||
if (unixSocket.setSocketDescriptor(connectingSocket,
|
||||
QAbstractSocket::ConnectedState, connectingOpenMode)) {
|
||||
q->QIODevice::open(connectingOpenMode | QIODevice::Unbuffered);
|
||||
q->QIODevice::open(connectingOpenMode);
|
||||
q->emit connected();
|
||||
} else {
|
||||
QString function = QLatin1String("QLocalSocket::connectToServer");
|
||||
|
Loading…
Reference in New Issue
Block a user