Hthrd_encode=CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE) Thread_stream, (LPVOID) this, 0, & amp; ThreadId_encode); If (hthrd_encode==NULL) { Printf (" create thread failed \ n "); } The CloseHandle (hthrd_encode); // The SetTimer (1200, NULL);
Then threads execute inside the while (1), circulation inside a non-blocking way accept UDP packets,
Question, right now, click on the main interface at any position of the dialog box or button, the interface will be stuck, showed no response, why?
CodePudding user response:
UDP can be handled through a variety of SOCKET mode, select, event, based on the MFC csocket ah, you can read data into the thread processing, in addition to select, generally have the notification message to you to read data, You can get a sleep look at (100), will also card?