summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qudpsocket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/socket/qudpsocket.cpp')
-rw-r--r--src/network/socket/qudpsocket.cpp32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/network/socket/qudpsocket.cpp b/src/network/socket/qudpsocket.cpp
index 9219f19..235003a 100644
--- a/src/network/socket/qudpsocket.cpp
+++ b/src/network/socket/qudpsocket.cpp
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtNetwork module of the Qt Toolkit.
@@ -21,9 +20,10 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this
+** package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
@@ -46,7 +46,7 @@
\reentrant
\brief The QUdpSocket class provides a UDP socket.
- \ingroup io
+ \ingroup network
\inmodule QtNetwork
UDP (User Datagram Protocol) is a lightweight, unreliable,
@@ -95,6 +95,13 @@
This enum describes the different flags you can pass to modify the
behavior of QUdpSocket::bind().
+ \note On Symbian OS bind flags behaviour depends on process capabilties.
+ If process has NetworkControl capability, the bind attempt with
+ ReuseAddressHint will always succeed even if the address and port is already
+ bound by another socket with any flags. If process does not have
+ NetworkControl capability, the bind attempt to address and port already
+ bound by another socket will always fail.
+
\value ShareAddress Allow other services to bind to the same address
and port. This is useful when multiple processes share
the load of a single service by listening to the same address and port
@@ -350,6 +357,9 @@ qint64 QUdpSocket::pendingDatagramSize() const
fragmented by the IP layer before arriving at their final
destination.
+ \warning In S60 5.0 and earlier versions, the writeDatagram return
+ value is not reliable for large datagrams.
+
\warning Calling this function on a connected UDP socket may
result in an error and no packet being sent. If you are using a
connected socket, use write() to send datagrams.
@@ -368,6 +378,16 @@ qint64 QUdpSocket::writeDatagram(const char *data, qint64 size, const QHostAddre
return -1;
qint64 sent = d->socketEngine->writeDatagram(data, size, address, port);
+#ifdef Q_OS_SYMBIAN
+ if( QSysInfo::s60Version() <= QSysInfo::SV_S60_5_0 ) {
+ // This is evil hack, but for some reason native RSocket::SendTo returns 0,
+ // for large datagrams (such as 600 bytes). Based on comments from Open C team
+ // this should happen only in platforms <= S60 5.0.
+ // As an workaround, we just set sent = size
+ if( sent == 0 )
+ sent = size;
+ }
+#endif
d->cachedSocketDescriptor = d->socketEngine->socketDescriptor();
if (sent >= 0) {
@@ -380,7 +400,7 @@ qint64 QUdpSocket::writeDatagram(const char *data, qint64 size, const QHostAddre
return sent;
}
-/*!
+/*!
\fn qint64 QUdpSocket::writeDatagram(const QByteArray &datagram,
const QHostAddress &host, quint16 port)
\overload