Note that there are some explanatory texts on larger screens.

plurals
  1. POWhen are IO completion port packets sent and when not?
    primarykey
    data
    text
    <p>I'm currently working on an IPC mechanism based on named pipes using a IO completion port.</p> <p>Unfortunately I have some troubles with the msdn documentation because it's quite unclear to me in which cases calls to ReadFile/WriteFile result in a completion packet.</p> <p>The case when FALSE is returned with ERROR_IO_PENDING is clear, but what about the apparently possible case, when ERROR_MORE_DATA is returned? Will there be a completion packet in this case? Moreover, what if other errors are returned? In which cases do i have to handle the result and free resources directly and not in the completion handler?</p> <p>Another case would be if ReadFile/WriteFile even succeed, which apparently is possible, too. MSDN is thankfully pretty clear about this <a href="http://msdn.microsoft.com/en-us/library/aa365683%28v=VS.85%29.aspx" rel="nofollow noreferrer">here</a>:</p> <blockquote> <p>Further, the WriteFile function will sometimes return TRUE with a GetLastError value of ERROR_SUCCESS, even though it is using an asynchronous handle (which can also return FALSE with ERROR_IO_PENDING). ... In this example, the recommendation would be to allow the completion port routine to be solely responsible for all freeing operations for such resources.</p> </blockquote> <p>Is this recommendation correct in all cases, and the result of an ReadFile/WriteFile operation for handles assigned to a completion port could (and should) in fact be ignored completely, because a packet is sent to the port anyways?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload