Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
2d16bfed
Commit
2d16bfed
authored
Aug 02, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop removing UDP hosts when data send fails.
parent
f8b8503c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
UDPLink.cc
src/comm/UDPLink.cc
+15
-2
No files found.
src/comm/UDPLink.cc
View file @
2d16bfed
...
...
@@ -46,6 +46,8 @@ This file is part of the QGROUNDCONTROL project
#include "QGC.h"
#include <QHostInfo>
#define REMOVE_GONE_HOSTS 0
static
const
char
*
kZeroconfRegistration
=
"_qgroundcontrol._udp"
;
static
bool
is_ip
(
const
QString
&
address
)
...
...
@@ -212,9 +214,20 @@ void UDPLink::_sendBytes(const char* data, qint64 size)
QHostAddress
currentHost
(
host
);
if
(
_socket
->
writeDatagram
(
data
,
size
,
currentHost
,
(
quint16
)
port
)
<
0
)
{
// This host is gone. Add to list to be removed
goneHosts
.
append
(
host
);
// We should keep track of hosts that were manually added (static) and
// hosts that were added because we heard from them (dynamic). Only
// dynamic hosts should be removed and even then, after a few tries, not
// the first failure. In the mean time, we don't remove anything.
if
(
REMOVE_GONE_HOSTS
)
{
goneHosts
.
append
(
host
);
}
}
else
{
// Only log rate if data actually got sent. Not sure about this as
// "host not there" takes time too regardless of size of data. In fact,
// 1 byte or "UDP frame size" bytes are the same as that's the data
// unit sent by UDP.
_logOutputDataRate
(
size
,
QDateTime
::
currentMSecsSinceEpoch
());
}
_logOutputDataRate
(
size
,
QDateTime
::
currentMSecsSinceEpoch
());
}
while
(
_config
->
nextHost
(
host
,
port
));
//-- Remove hosts that are no longer there
foreach
(
QString
ghost
,
goneHosts
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment