Hi,
I am developing a realtime application.
I have a server that is written in C and this pumps data to the server at the maximum possible rate.
i tried using Qt sockets to receive the data from the server. i used readyread signal to read the data from the socket and display. The code is given below.

i find some data loss out of the 1000 messge sent from server to the client, i receive only 967.
but the same when i receive it with C sockets i am able to receive all the 1000 data from the server. can anyone tell where the problem is?
if not please tell the way to improve the performance. i tried using Qt::AutoConnection also but the result was the same.


Qt Code:
  1. QObject::connect(m_tcpsocket,SIGNAL(readyRead()),this,SLOT(readmsg()),Qt::DirectConnection);
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. void QClass1::readmsg()
  2. {
  3. m_count++;
  4. printf("\nCOUNT: %d",m_count);
  5. S_Msg m_header;// this is a structure
  6. void *ptr=&m_header;
  7. m_tcpsocket->read((char *)ptr,MSG_SIZE);
  8. printf("\n\nRecieved ID ");
  9. printf("%x",m_header.id);
  10.  
  11. switch(m_header.id)
  12. {
  13. case 1:
  14. {
  15. S_LOT plt; //object for struct S_LOT
  16. void *vptr_msg=&plt.th;
  17. m_tcpsocket->read((char *)vptr_msg,LOT_SIZE-MSG_SIZE);
  18. emit Signal1(plt);
  19. break;
  20. }
  21. .
  22. .
  23. .
  24. .
  25. default:
  26. //
  27. }
  28. }
To copy to clipboard, switch view to plain text mode 
Count output with Qt Sockets for 1000msgs sent from the server was 978
Count output with C Sockets for 1000msgs sent from the server was 1000


--
pls help