Commit 4667d1d8 authored by Mark Whitehorn's avatar Mark Whitehorn

add diagnostic message for UDP datagram overflow

parent 282d1258
......@@ -553,8 +553,12 @@ void QGCXPlaneLink::readBytes()
quint16 senderPort;
unsigned int s = socket->pendingDatagramSize();
if (s > maxLength) std::cerr << __FILE__ << __LINE__ << " UDP datagram overflow, allowed to read less bytes than datagram size" << std::endl;
if (s > maxLength) std::cerr << __FILE__ << __LINE__ << " UDP datagram overflow, allowed to read less bytes than datagram size: " << s << std::endl;
socket->readDatagram(data, maxLength, &sender, &senderPort);
if (s > maxLength) {
std::string headStr = std::string(data, data+5);
std::cerr << __FILE__ << __LINE__ << " UDP datagram header: " << headStr << std::endl;
}
// Calculate the number of data segments a 36 bytes
// XPlane always has 5 bytes header: 'DATA@'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment