Solved

Named Pipe

Posted on 1998-04-04
4
1,088 Views
Last Modified: 2012-08-13
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.
0
Comment
Question by:lilya
4 Comments
 
LVL 2

Expert Comment

by:eelko
ID: 1258002
Shouldn't you close the pipe handle in the client program ?
0
 

Author Comment

by:lilya
ID: 1258003
Edited text of question
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1258004
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
 

Accepted Solution

by:
danbala earned 100 total points
ID: 1258005
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

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem with MFCApp 78 421
An API detour question 7 94
How to learn Linux? 10 67
Setting variables in a stored procedure 5 22
Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question