Re: ReadFile blocking even when it shouldn't
- From: "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp>
- Date: Wed, 12 Oct 2005 07:49:21 -0500
aaa wrote:
I have an application where the main thread holds three subthreads. All three threads have message handling routines (MsgWaitForMultipleObjects and WSAWaitForMultipleEvents). However, going through the code with the debugger one of the threads seem to get stuck at a call to ReadFile which should be non-blocking (see below). Why does this method block?
ZeroMemory(&l_this->m_overlapped, sizeof(l_this->m_overlapped));
l_handleArray[1] = CreateEvent(NULL, TRUE, FALSE, "COMPORTEVENT");
l_this->m_overlapped.hEvent = l_handleArray[1];
ReadFile(l_this->m_hCOMport, &l_recvStr, sizeof(char) * (l_recvStrLen - 1), NULL, &l_this->m_overlapped); //Why does it block here?
Too much detail about irrelevant things, not enough detail about relevant things. Does your CreateFile call open the port for overlapped I/O? Which Windows version are you using?
-- Scott McPhillips [VC++ MVP]
.
- Prev by Date: Re: GetOverlappedResult returns unreasonable sized read bytes
- Next by Date: Re: IDE Tabs percularity with 7.1
- Previous by thread: Re: GetOverlappedResult returns unreasonable sized read bytes
- Next by thread: adding resource cpp files
- Index(es):
Relevant Pages
|