In Windows CE, UDP is used for communication (based on evdo or GPRS ). Check an event in the UDP receiving thread to exit data receiving. Received Code Omitted ...... uint ceudp: recvthread (lpvoid lparam ){ While (true) { // Receives the exit event and ends the thread If (wait_object_0 = waitforsingleobject (psocket-> m_hexitthreadevent, 0 )) { Break; } ...... } Return 0;} The UDP closing code is as follows: setevent (m_hexitthreadevent); sleep (1000); closehandle (m_hexitthreadevent); If (closesocket (m_udpsocket) = socket_error) will the code logic on {return-1;} Cause the socket error 10055 error? My understanding: first set the exit event, causing the receiving thread to exit. At this time, the data received by the socket is not taken away. One second after the receiving thread exits, the socket closure operation is executed. The received data was not processed during this time.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.