Elided settings limit error
-
I connect a device with TCP server and I receive data. When I connect a device I response theese messages
[[[... Elided 4543 characters due to settings limit ...]]] [[[... Elided 5143 characters due to settings limit ...]]] [[[... Elided 4143 characters due to settings limit ...]]] [[[... Elided 6643 characters due to settings limit ...]]] [[[... Elided 4213 characters due to settings limit ...]]] [[[... Elided 4553 characters due to settings limit ...]]] [[[... Elided 4513 characters due to settings limit ...]]]I wrote test server with python and I do not receive theese message. Maybe receive rate high on device, I do not know now.
Why it happend and how could I up settings limit, because I see only that and I could not see any other debug messages
@Joe-von-Habsburg This is not much information to guess what could be wrong.
You say nothing about how you connect, how you receive data. You do not show any code... -
I Use TCP
That main socket class
#include "MySocket.h" MySocket::MySocket(QString remoteIp, int remotePort, QObject *parent) : QObject{parent} , _remoteIp(remoteIp) , _remotePort(remotePort) { } MySocket::~MySocket() { close(); } void MySocket::open() { _socket = new QTcpSocket(this); connect(_socket, &QTcpSocket::readyRead, this, &MySocket::readyRead); _socket->abort(); _socket->connectToHost(_remoteIp, _remotePort); } void MySocket::close() { if(!_socket) return; _socket->close(); _socket->abort(); _socket->disconnectFromHost(); } void MySocket::readyRead() { QByteArray data = _socket->readAll(); parseData(data); }Any Socket class
#include "AnySocket.h" AnySocket::AnySocket(QString remoteIp, int remotePort, QObject *parent) : MySocket{remoteIp, remotePort, parent} {} void AnySocket::parseData(QByteArray data) { QDataStream stream(data); stream.setByteOrder(QDataStream::LittleEndian); stream.setFloatingPointPrecision(QDataStream::SinglePrecision); //... emit sendData(mystruct); }I have 5-6 AnySocket (just parse data different because data different) connection for different ports;
// send to mainwindow.cpp and I use data, for example write values to qlabel or qtablewidget and some calculating things emit sendData(mystruct); -
I Use TCP
That main socket class
#include "MySocket.h" MySocket::MySocket(QString remoteIp, int remotePort, QObject *parent) : QObject{parent} , _remoteIp(remoteIp) , _remotePort(remotePort) { } MySocket::~MySocket() { close(); } void MySocket::open() { _socket = new QTcpSocket(this); connect(_socket, &QTcpSocket::readyRead, this, &MySocket::readyRead); _socket->abort(); _socket->connectToHost(_remoteIp, _remotePort); } void MySocket::close() { if(!_socket) return; _socket->close(); _socket->abort(); _socket->disconnectFromHost(); } void MySocket::readyRead() { QByteArray data = _socket->readAll(); parseData(data); }Any Socket class
#include "AnySocket.h" AnySocket::AnySocket(QString remoteIp, int remotePort, QObject *parent) : MySocket{remoteIp, remotePort, parent} {} void AnySocket::parseData(QByteArray data) { QDataStream stream(data); stream.setByteOrder(QDataStream::LittleEndian); stream.setFloatingPointPrecision(QDataStream::SinglePrecision); //... emit sendData(mystruct); }I have 5-6 AnySocket (just parse data different because data different) connection for different ports;
// send to mainwindow.cpp and I use data, for example write values to qlabel or qtablewidget and some calculating things emit sendData(mystruct);@Joe-von-Habsburg And where in your code does this "Elided..." output come from? I mean what is executed in your code (which is not complete, parsing for example is not shown, also what you do with the data after parsing) when this is printed? You should really do some debugging first...
-
@Joe-von-Habsburg And where in your code does this "Elided..." output come from? I mean what is executed in your code (which is not complete, parsing for example is not shown, also what you do with the data after parsing) when this is printed? You should really do some debugging first...
@jsulm said in Elided settings limit error:
And where in your code does this "Elided..." output come from?
Whenever I connect to any port, I get this output on the device. As I mentioned, I connect to 5 or 6 different ports, but even if I connect to just one of them for testing, I still get this output.
@jsulm said in Elided settings limit error:
for example is not shown
I read with stream and set values, there are lots of variable.
quint32 val1; float val2; stream >> val1 >> val2; MyStruct myStruct; myStruct.val1 = val1; myStruct.val2= val2;@jsulm said in Elided settings limit error:
also what you do with the data after parsing
void MainWindow::sendStatusData(MyStruct data) { ui->lbl_eg_status_packet_shema_version->setText(QString("%1.%2.%3.%4").arg(data.packet_shema_version[0]).arg(data.packet_shema_version[1]).arg(data.packet_shema_version[2]).arg(data.packet_shema_version[3])); ui->lbl_eg_status_serial_number->setText(data.serial_number); //... } // or void MainWindow::sendCallculateData(MyCalculateStruct data) { checkCalculate(); for(CalculateData &calculateData : data.calcualtes){ bool exist = false; int index = -1; for(int i = 0; i < _calculates.size(); i++){ if(calculateData .calculate_id== _calculates[i].id){ exist = true; index = i; break; } } if(exist){ _calculates[index].val1= calculateData .val1; _calculates[index].val2= calculateData .val2; } else{ CalculateData calculate; calculate.id = calculateData .calculate_id; calculate.val1= calculateData .val1; calculate.val2= calculateData .val2; _calculates.append(calculate); } } } -
How big are the packets sent?
-
each server send different size of packets, min 352 B, max 292000 B
-
each server send different size of packets, min 352 B, max 292000 B
@Joe-von-Habsburg
My (admittedly limited) understanding is that TCP packets are ~1,500 bytes (with an absolute limit of 64k which is still less than your maximum). I don't know whether it's reporting those >1.5k? And the "elided" and "settings limit" comes from unknown source? -
I think it might be like this: I’m constantly receiving data, but I can’t process it at the same rate, so it builds up.
void Socket::readyRead() { QByteArray data = _socket->readAll(); parseData(data); }could it be, lots of packet (more than 1) in _socket->readAll();
-
I think it might be like this: I’m constantly receiving data, but I can’t process it at the same rate, so it builds up.
void Socket::readyRead() { QByteArray data = _socket->readAll(); parseData(data); }could it be, lots of packet (more than 1) in _socket->readAll();
@Joe-von-Habsburg If you comment out parseData(data) - do you still see that elided messages?
-
Moved the 'QtCreator and other tools' as this is a question on QtCreator debug output even though OP did not mentioned it.
-
C Christian Ehrlicher moved this topic from General and Desktop