Hello,
i've programmed a test-application in QT4-3-4 for Windows (Commercial eval for VS2003) to get maximum UDP-throghput.
The application is a simple receiver, that gets UDP-datagrams and calculates throughput. We also have a sender (written in C, WinAPI) and several receivers (C, C#, Java...). Now we are testing QT's performance. With C, WSA, we got results of astonishing 900-950MBit/s.
The QT-application has two threads, one for GUI and one only for receiving. I used QUdpSocket-class, but results were as bad as 35-40MBit/s.
What is wrong it?? Has anyone same experiences??
Here is how i did it (only the receiving function in the 2nd thread):
void sTestThread::run()
{
quint32 dgs = 0;
started = true;
initRecv();
while ( started )
{
psock->waitForReadyRead( 20 );
if ( psock->hasPendingDatagrams() )
{
fill = psock->pendingDatagramSize();
psock->readDatagram( buffer, MAX_UDPSIZE, 0, 0 );
dgs++;
checkDg();
}
}
deinitRecv();
}
void sTestThread::run()
{
quint32 dgs = 0;
started = true;
initRecv();
while ( started )
{
psock->waitForReadyRead( 20 );
if ( psock->hasPendingDatagrams() )
{
fill = psock->pendingDatagramSize();
psock->readDatagram( buffer, MAX_UDPSIZE, 0, 0 );
dgs++;
checkDg();
}
}
deinitRecv();
}
To copy to clipboard, switch view to plain text mode
regards and thanks
tigertap
Bookmarks