• C

Named Pipe

I am using named pipe mechanism for interproces communication . My server programm cteates
local named pipe with one pipe instance, connects to the pipe and read.  After some timeout  it disconnect from pipe and close pipe handle. . After  disconnecting and closing the pipe handle,
server tries to create pipe with the same name and parameters and connects to it , but GetLastError
back error 231 (All pipe instances are busy. ERROR_PIPE_BUSY). In the client side I connect to the
pipe with CreateFile and write. I never close the pipe handle in the client programm.  What's  wrong in this scenario and what's the rihgt way for using named pipe ?
Yes. I close client pipe handle.
lilyaAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
danbalaConnect With a Mentor Commented:
You have to cloes either the server's read end and the client's write end
or vice-versa! -before reading or writing to the pipe!!!

0
 
eelkoCommented:
Shouldn't you close the pipe handle in the client program ?
0
 
lilyaAuthor Commented:
Edited text of question
0
 
q2guoCommented:
Hi Lilya

You said in your question:
"I never close the pipe handle in the client program"
"I close client pipe handle. "

I am confused, did you close the client pipe handle before recreating the pipe using the server, or didn't you?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.