X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fnetworkconnection.h;h=959eb740e285708b917026976933a35fd0565903;hp=5f593137b16d01a92d11f186c8ec4ca4bb4b1172;hb=c6b3980fe063e5022882a31a132dec6952f8c6a7;hpb=40fd2239205d9926296ccf60474a1aeb53c06c53 diff --git a/src/core/networkconnection.h b/src/core/networkconnection.h index 5f593137..959eb740 100644 --- a/src/core/networkconnection.h +++ b/src/core/networkconnection.h @@ -147,6 +147,8 @@ private slots: void sslErrors(const QList &errors); #endif + void fillBucketAndProcessQueue(); + private: #ifndef QT_NO_OPENSSL QSslSocket socket; @@ -180,6 +182,15 @@ private: int _autoWhoDelay; QTimer _autoWhoTimer, _autoWhoCycleTimer; + QTimer _tokenBucketTimer; + int _messagesPerSecond; // token refill speed + int _burstSize; // size of the token bucket + int _tokenBucket; // the virtual bucket that holds the tokens + QList _msgQueue; + + void writeToSocket(QByteArray s); + + class ParseError : public Exception { public: