diff options
Diffstat (limited to 'client/decoder.cc')
-rw-r--r-- | client/decoder.cc | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/client/decoder.cc b/client/decoder.cc index 0ed2032..c5b2876 100644 --- a/client/decoder.cc +++ b/client/decoder.cc @@ -85,8 +85,19 @@ void Decoder::run() sender->start(); newconnection = false; } - senders.front()->pushFrame(frame, false, false); + senders.back()->pushFrame(frame, false, false); } else { + // Remove idle senders + QLinkedList<NetworkSender*>::iterator i; + for (i = senders.begin(); i != senders.end(); i++) { + NetworkSender *ns = *i; + if(ns->queueSize() == 0) { + i = senders.erase(i); + ns->stop(); + delete ns; + } + } + free(frame); newconnection = true; } @@ -129,3 +140,16 @@ bool Decoder::eventFilter(QObject *o, QEvent *e) // standard event processing return false; } + +Status Decoder::status() +{ + Status s; + + QLinkedList<NetworkSender*>::iterator i; + for(i = senders.begin(); i != senders.end(); i++) { + NetworkSender *ns = *i; + s.queue_sizes.push_back(ns->queueSize()); + } + + return s; +} |