Elide duplicate UDP messages

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6315 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2015-12-24 21:37:16 +00:00
parent 3c428b139a
commit 96a65b331d

View File

@ -74,6 +74,7 @@ public:
// hold messages sent before host lookup completes asynchronously
QQueue<QByteArray> pending_messages_;
QByteArray last_message_;
};
#include "MessageClient.moc"
@ -233,7 +234,11 @@ void MessageClient::impl::send_message (QByteArray const& message)
{
if (!server_.isNull ())
{
writeDatagram (message, server_, server_port_);
if (message != last_message_) // avoid duplicates
{
writeDatagram (message, server_, server_port_);
last_message_ = message;
}
}
else
{