diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2009-07-22 07:59:54 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2009-07-23 10:18:38 (GMT) |
commit | d6a01d0f948361ac5cacab0bf9f8585041485259 (patch) | |
tree | f17bc439920c2f366be9528cf41bc45e69209fc3 /src/network/socket/qabstractsocket.h | |
parent | 9377881d6d6f5c07aa134c8f1708d0afd0d06e86 (diff) | |
download | Qt-d6a01d0f948361ac5cacab0bf9f8585041485259.zip Qt-d6a01d0f948361ac5cacab0bf9f8585041485259.tar.gz Qt-d6a01d0f948361ac5cacab0bf9f8585041485259.tar.bz2 |
Sockets: Added support for SO_KEEPALIVE and TCP_NODELAY
Introduce QAbstractSocket::setSocketOption that allows
to set the socket options for TCP Keep Alive and
TCP_NODELAY (disabling Nagle's Algorithm).
Reviewed-by: Thiago
Diffstat (limited to 'src/network/socket/qabstractsocket.h')
-rw-r--r-- | src/network/socket/qabstractsocket.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/network/socket/qabstractsocket.h b/src/network/socket/qabstractsocket.h index ed187e5..50a38bb 100644 --- a/src/network/socket/qabstractsocket.h +++ b/src/network/socket/qabstractsocket.h @@ -116,6 +116,10 @@ public: Connection = ConnectedState #endif }; + enum SocketOption { + LowDelayOption, // TCP_NODELAY + KeepAliveOption // SO_KEEPALIVE + }; QAbstractSocket(SocketType socketType, QObject *parent); virtual ~QAbstractSocket(); @@ -149,6 +153,10 @@ public: bool setSocketDescriptor(int socketDescriptor, SocketState state = ConnectedState, OpenMode openMode = ReadWrite); + // ### Qt 5: Make virtual? + void setSocketOption(QAbstractSocket::SocketOption o, QVariant v); + QVariant socketOption(QAbstractSocket::SocketOption o); + SocketType socketType() const; SocketState state() const; SocketError error() const; |