Remoting Events - only raise event in some clients

  • Thread starter Thread starter Sanjit Suchak
  • Start date Start date
S

Sanjit Suchak

Hi,

I am just learning about .net remoting and have managed to get it working.

However, I now want to write a basic chat program.

The problem I've got is getting the server to only fire events to some of
the clients.

eg. Client 1 and Client 2 are connected to the Server

Client 1 calls the Message Send event on the server - the server raises an
event. The event is received by both Client 1 and Client 2.

What I would like is for only Client 2 to receive the event.

The way I have got round this at the moment is by saving the Client name in
the Client ... sending the client name to the server when calling the method
.... the server raises the event and sends back the client name in the event
parameters ... The Client receives the event, checks the client name - if
client name belongs to this client then the client ignores the event.

It works, but that's quite an overhead if I had 10000 clients attached ...

Thanks

Sanj
 
Hi,

I guess the problem is, it is implemented as a SAO, so it
just does a broadcast and all the clients receive the
event.

My best bet would be to implement it as a CAO. This
should do what you require.

Regards,
Madhu

MVP | MCSD.NET
 
Back
Top