[Qt-interest] My code Crash application

srecko srecko at feniks-sd.hr
Sat Feb 14 05:51:12 CET 2009


Hay, I have code. 

//code
 void MikrotikCodeImpl::processPendingDatagrams()
{    
udpSocket->bind(5678);
udpSocket->hasPendingDatagrams() ;
QByteArray datagram;
datagram.resize(udpSocket->pendingDatagramSize());
QHostAddress sender;
quint16 senderPort;
udpSocket->readDatagram(datagram.data(), datagram.size() ,&sender, &senderPort);
statusBar()->showMessage(tr("Received datagram: \"%1\"")
                           .arg(datagram.size()));

 
      }
//end code

But, this code crash my aplikation.

//debug

 Debug...
(gdb) (gdb) (gdb) (gdb) (gdb) Starting program: /home/kris/C++/projekti/mikrotik_code/bin/mikrotik_code 
[Thread debugging using libthread_db enabled]
[New Thread 0x42786950 (LWP 10320)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f22b4a626f0 (LWP 10317)]
0x00007f22b39c30f9 in QUdpSocket::bind () from /usr/lib/libQtNetwork.so.4
(gdb) 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090214/df800b0e/attachment.html 


More information about the Qt-interest-old mailing list