summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-01-12 13:58:50 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2011-01-12 13:58:50 (GMT)
commit29929a3c6368f62cdb58bd7255aa6f93e8d9f2f6 (patch)
tree1aa43c05de341314e08ec051dca94893d1049a26 /src/network
parent6beb46f6e2971188c13d8b2922eaa3801a890b71 (diff)
downloadQt-29929a3c6368f62cdb58bd7255aa6f93e8d9f2f6.zip
Qt-29929a3c6368f62cdb58bd7255aa6f93e8d9f2f6.tar.gz
Qt-29929a3c6368f62cdb58bd7255aa6f93e8d9f2f6.tar.bz2
Fix non blocking connect on symbian devices
The socket server returns KErrAlreadyExists rather than KErrNone when connect is called as second time after the select ioctl completes. Reviewed-by: Markus Goetz Reviewed-by: Aaron Tunney
Diffstat (limited to 'src/network')
-rw-r--r--src/network/socket/qsymbiansocketengine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/socket/qsymbiansocketengine.cpp b/src/network/socket/qsymbiansocketengine.cpp
index a1ff9b9..2f991de 100644
--- a/src/network/socket/qsymbiansocketengine.cpp
+++ b/src/network/socket/qsymbiansocketengine.cpp
@@ -578,7 +578,10 @@ bool QSymbianSocketEngine::connectToHost(const QHostAddress &addr, quint16 port)
User::WaitForRequest(status);
TInt err = status.Int();
//TODO: combine with setError(int)
- if (err) {
+ //For non blocking connect, KErrAlreadyExists is returned from the second Connect() to indicate
+ //the connection is up. So treat this the same as KErrNone which would be returned from the first
+ //call if it wouldn't block. (e.g. winsock wrapper in the emulator ignores the nonblocking flag)
+ if (err && err != KErrAlreadyExists) {
switch (err) {
case KErrWouldBlock:
d->socketState = QAbstractSocket::ConnectingState;