mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-12-25 20:33:08 -05:00
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:
parent
3c428b139a
commit
96a65b331d
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user