[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3497
  • Last Modified:

Named Pipes server with multiple clients

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
avitalk
Asked:
avitalk
  • 2
  • 2
2 Solutions
 
avitalkAuthor Commented:
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
 
CuteBugCommented:
Yes... that would be a better approach.
0
 
avitalkAuthor Commented:
no solution was found
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now