patricerolland wrote:
hi all, how can i detect that a pipe is frozen in c++ ? I mean if for
example the application that receives the pipe has a problem ? my code
belowed :
if (! CreatePipe(&hChildStdinRd, &poempdev->hChildStdinWr, &saAttr,
0))
ERR(ERRORTEXT("Error %d :Stdin pipe creation failed.\r
\n"),GetLastError());
if (!WriteFile(poempdev->hChildStdinWr, szBuf, cbBuffer, &poempdev-
>dwResult, NULL))
tks in advance
Patrice Rolland
A single thread cannot detect whether it has been blocked by I/O. You
would need a second thread and an event common for both. Decide on the
timeout for the event, spin off the second thread, let it wait for the
event. The I/O thread should only set the event after I/O is complete.
The second thread will wait for the event, and if it times out, cancel
the I/O operation (don't ask how, it's not specific to C++).
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask