summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@nokia.com>2010-06-10 12:14:18 (GMT)
committerJoerg Bornemann <joerg.bornemann@nokia.com>2010-06-10 13:31:18 (GMT)
commit98da12415aa8bb7497120cd841e7a798e3e5206e (patch)
treed3d790566bed9c490bc5839c2c93712f32f8feb1
parent12614b2c5aaaed44ef9b3d1b3f6dbf50fd2d405f (diff)
downloadQt-98da12415aa8bb7497120cd841e7a798e3e5206e.zip
Qt-98da12415aa8bb7497120cd841e7a798e3e5206e.tar.gz
Qt-98da12415aa8bb7497120cd841e7a798e3e5206e.tar.bz2
QLocalSocket/Win: QLocalSocketPrivate::bytesAvailable renamed
QLocalSocketPrivate::bytesAvailable has been renamed to QLocalSocketPrivate::checkPipeState to match the purpose of this method. Reviewed-by: ossi
-rw-r--r--src/network/socket/qlocalsocket_p.h2
-rw-r--r--src/network/socket/qlocalsocket_win.cpp12
2 files changed, 8 insertions, 6 deletions
diff --git a/src/network/socket/qlocalsocket_p.h b/src/network/socket/qlocalsocket_p.h
index 0f1c23c..57ca3c2 100644
--- a/src/network/socket/qlocalsocket_p.h
+++ b/src/network/socket/qlocalsocket_p.h
@@ -135,7 +135,7 @@ public:
void _q_canWrite();
void _q_pipeClosed();
void _q_emitReadyRead();
- DWORD bytesAvailable();
+ DWORD checkPipeState();
void startAsyncRead();
bool completeAsyncRead();
void checkReadyRead();
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp
index dc87ade..aa597da 100644
--- a/src/network/socket/qlocalsocket_win.cpp
+++ b/src/network/socket/qlocalsocket_win.cpp
@@ -251,7 +251,7 @@ void QLocalSocketPrivate::checkReadyRead()
void QLocalSocketPrivate::startAsyncRead()
{
do {
- DWORD bytesToRead = bytesAvailable();
+ DWORD bytesToRead = checkPipeState();
if (bytesToRead == 0) {
// There are no bytes in the pipe but we need to
// start the overlapped read with some buffer size.
@@ -334,9 +334,11 @@ void QLocalSocket::abort()
}
/*!
- The number of bytes available from the pipe
- */
-DWORD QLocalSocketPrivate::bytesAvailable()
+ \internal
+ Returns the number of available bytes in the pipe.
+ Sets QLocalSocketPrivate::pipeClosed to true if the connection is broken.
+ */
+DWORD QLocalSocketPrivate::checkPipeState()
{
Q_Q(QLocalSocket);
DWORD bytes;
@@ -531,7 +533,7 @@ bool QLocalSocket::waitForDisconnected(int msecs)
}
QIncrementalSleepTimer timer(msecs);
forever {
- d->bytesAvailable(); // to check if PeekNamedPipe fails
+ d->checkPipeState();
if (d->pipeClosed)
close();
if (state() == UnconnectedState)