Solved

Named Pipes server with multiple clients

Posted on 2009-05-11
4
3,012 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

895 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

15 Experts available now in Live!

Get 1:1 Help Now