Can a Windows named pipe created in OVERLAPPED (async) mode be used for sync communications as well?

196 Views Asked by At

I have a Named pipe process that uses Async communication, it is created by calling CreateNamedPipe with FILE_FLAG_OVERLAPPED, on the client process the pipe is opened using CreateFile with the same flag and connected with ConnectNamedPipe.

My question is if I can use the same named pipe for synchronized communication too? I am not sure since the documentation states that :

If hNamedPipe was opened with FILE_FLAG_OVERLAPPED, the lpOverlapped parameter must not be NULL. It must point to a valid OVERLAPPED structure. If hNamedPipe was opened with FILE_FLAG_OVERLAPPED and lpOverlapped is NULL, the function can incorrectly report that the connect operation is complete.

Does this mean the pipe must only be used for Async actions?

Thanks.

0

There are 0 best solutions below