For some reason if I start a select() statement while I'm resizing my QMainWindow, the select() returns instantly and my recvfrom command hangs.

Is there anyway a resizeEvent would put info on a port somehow?

I'm wondering if there is a way to check if the window is getting resized, but this seems like a kludge because I'm not sure what other events would do this as well.

Here is my select function that calls itself every check_interval:

Qt Code:
  1. void MyClient::checkForData() {
  2. logEvent( "About to check for data.", 2 );
  3. char rbuffer[1024];
  4. struct sockaddr_in from;
  5. size_t fromlen = sizeof( from );
  6.  
  7. // set up variables to make the select call
  8. struct timeval tv;
  9. tv.tv_sec = wait_time_seconds; // how long to wait
  10. tv.tv_usec = wait_time_microseconds;
  11. fd_set read_fds;
  12. FD_SET( sock, &read_fds );
  13. logEvent( "Checking for data.", 1 );
  14.  
  15. int num_responses = 0;
  16. if ( num_responses = select( sock+1, &read_fds, NULL, NULL, &tv ) > 0 ) {
  17. logEvent( QString( "Received data on %1 sockets." ).arg( num_responses ), 2 );
  18. recvfrom( sock, &rbuffer, sizeof( rbuffer ), 0, (struct sockaddr *) &from, &fromlen );
  19. QString the_response( rbuffer );
  20. logEvent( "The response: '" + the_response + "'", 4 );
  21. emit responseReady( the_response );
  22. } else {
  23. logEvent( "No response.", 4 );
  24. }
  25.  
  26. QTimer::singleShot( check_interval, this, SLOT( checkForData() ) );
  27. }
To copy to clipboard, switch view to plain text mode 

If I resize it when the code checks the socket with the select call I only see:

About to check for data.
Checking for data.
Received data on 1 sockets.
And then it freezes.