Wait for named pipe

Hi,

I have question about named pipes in windows.
Client pipe app should call
WaitNamedPipe and this function waits for named pipe.
Next app calls CreateFile.

I need different solution for waiting for pipe ( if exists).
I need event created by CreateEvent and when event is set it means that named pipe exists and its ready.

Iam trying add named pipes to boost:asio and there is no problem with server named pipe
becouse server call  ConnectNamedPipe and waits for client. Then i get LPOVERLAPPED that asio need.

BOOL WINAPI ConnectNamedPipe(
  __in         HANDLE hNamedPipe,
  __inout_opt  LPOVERLAPPED lpOverlapped
);


 

lavitzAsked:
Who is Participating?
 
jkrConnect With a Mentor Commented:
0
 
lavitzAuthor Commented:
yes, iam using this function to wait when server creates pipe. But iam search for  solution with windows event.
0
 
lavitzAuthor Commented:
Ok, i was thinking that WaitNamedPipe waits even named pipe was not created. Its work before and i dont know how. So could someone confirm this?
0
 
parnassoConnect With a Mentor Commented:
I can confirm that WaitNamedPipe returns inmediately if the named piped has not been created yet.

About the overlapped question, could you be more clear?
0
All Courses

From novice to tech pro — start learning today.