Solved

Named Pipes server with multiple clients

Posted on 2009-05-11
4
3,170 Views
Last Modified: 2013-11-05
Hi all,

I have a project that needs some inter process communication.
I'm looking at using Named Pipes for this purpose.

I mananged to create a Server instance ( class NamedPipeServerStream ),
and a Client instance ( class NamedPipeClientStream),
connect them and exchange messages and binary data by using asynchronous methods -
BeginWaitForConnection  , BeginRead , BeginWrite.

I'm trying to connect more then one client to the Pipe Service and I can't do it.

After the first client has connected, I'm getting an exception when try to listen for another connection:
NamedPipeServerStream.BeginWaitForConnection  
throws a InvalidOperationException with the message "Already in a connected state."

How can I create a server that will allow multiple clients.

Thank you,
Avital
0
Comment
Question by:avitalk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 16

Assisted Solution

by:CuteBug
CuteBug earned 50 total points
ID: 24353575
0
 
LVL 1

Author Comment

by:avitalk
ID: 24357383
Thank you.
But I don't understand how that's helpful.
Do you mean that I should be using sockets instead of named pipes ?
0
 
LVL 16

Expert Comment

by:CuteBug
ID: 24360391
Yes... that would be a better approach.
0
 
LVL 1

Accepted Solution

by:
avitalk earned 0 total points
ID: 24420210
no solution was found
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

630 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