Merging r732:766 from trunk to branches/0.3.
[quassel.git] / src / core / networkconnection.h
index 5f59313..959eb74 100644 (file)
@@ -147,6 +147,8 @@ private slots:
   void sslErrors(const QList<QSslError> &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<QByteArray> _msgQueue;
+
+  void writeToSocket(QByteArray s);
+
+
 
   class ParseError : public Exception {
   public: