serial communication with IOCP

carr 帅 <shuaixh-/[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
hello :
i use IOCP in serial communication, RS232.
 
   BOOL bOK = ::GetQueuedCompletionStatus(m_hCompletion, 
    &dwTrans, (LPDWORD)&dwKey, (LPOVERLAPPED*)&lpol, INFINITE);
 
the function above won't block when the serial port no data comming.
the return value is TRUE.
GetQueuedCompletionStatus should blocked, when no data received,
but it always returns, and the dwTrans is Zero, implying no data.
when there's some data received, the dwTrans is the number of the data,
and i can fetch data from buffer, that is correct.
Each time i get a read-finished notification, i read the data, and post another
read request, eg. calling "ReadFile".
 If i comment out "ReadFile", GetQueuedCompletionStatus did blocked, but 
i can never receive any data anymore.
 
so, how to let the function(GetQueuedCompletionStatus ) block, when there's no data ???
by the way, the similar codes works well with Winsock.
thanks.


      ___________________________________________________________ 
  好玩贺卡等你发,邮箱贺卡全新上线! 
http://card.mail.cn.yahoo.com/

[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.