I try to send UDP massage but I got this massage
error.PNG
How can I fix this
here is my UDP sender code
QString datagrama
= ui
->lw_catalogList
->currentItem
()->text
();
qDebug() << datagrama;
//mSocket->writeDatagram()
ui->lw_entityList->currentItem();
int names = ui->lw_entityList->count();
for(int i = 0; i < names; i++)
{
allNamesAsAList << ui->lw_entityList->item(i)->text().toLatin1();
}
qDebug() << allNamesAsAList;
for(int j = 0; j <= allNamesAsAList.size(); j++){
entity.append(allNamesAsAList.at(j));
mSocket
->writeDatagram
(entity,
QHostAddress::LocalHost,
12345);
}
QString datagrama = ui->lw_catalogList->currentItem()->text();
qDebug() << datagrama;
//mSocket->writeDatagram()
ui->lw_entityList->currentItem();
QStringList allNamesAsAList;
int names = ui->lw_entityList->count();
for(int i = 0; i < names; i++)
{
allNamesAsAList << ui->lw_entityList->item(i)->text().toLatin1();
}
qDebug() << allNamesAsAList;
for(int j = 0; j <= allNamesAsAList.size(); j++){
QByteArray entity;
entity.append(allNamesAsAList.at(j));
mSocket->writeDatagram(entity, QHostAddress::LocalHost,12345);
}
To copy to clipboard, switch view to plain text mode
Bookmarks