deatc
asked on
CreateFile() Call Fails for Named Pipe
Hi. I have a server application that creates a named pipe using the following call:
CreateNamedPipe( "\\\\.\\pipe\\MyPipe" ,
(PIPE_ACCESS_DUPLEX | WRITE_DAC) ,
(PIPE_TYPE_BYTE | PIPE_READMODE_BYTE PIPE_WAIT) ,
10 ,
1024 ,
1024 ,
0 ,
0 );
and a client application that does the following twice: WaitNamedPipe( "\\\\.\\pipe\\MyPipe" ,
NMPWAIT_WAIT_FOREVER );
hOut = CreateFile( "\\\\.\\pipe\\MyPipe" ,
GENERIC_WRITE ,
0 ,
NULL ,
OPEN_EXISTING ,
FILE_ATTRIBUTE_NORMAL ,
NULL );
WriteFile( hOut ,
"Hello" ,
5 ,
&dwBytesWritten ,
NULL ) );
CloseHandle(hOut);
Everything works great the first time, but the second time, the CreateFile() client call never returns. Do you have any idea what the problem could be? Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER