Solved

Named Pipes server with multiple clients

Posted on 2009-05-11
4
2,989 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
  • 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now