Remoting with multiple clients

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

I have a c# program that holds a several objects. I would like this
these objects sent to to several clients using remoting across
seperate machines at a certain times that is determined by the
computer that the object resides on.
I have looked into remoting but I am getting confused as to what
method to use to achieve this kind of result. Can I have several
clients all using the same channel listening for a method call with my
object as a parameter? Which commands would I use to enable this? Any
Guidance would help.

Thnaks
Nick
 
Nick,

Yes, you can do this. You would have to know how to connect to each of
the machines beforehand though. Basically, if you were using the TCP
channel, you would have to know the IP address and the port that they are
listening on (you would have to pick a high-level port that is typically
unused by anything else).

Since this can be a pain to manage, you should have two channels set up.
The main service would have a well known address which all the clients
connect on. Then, they tell the service (through a call), the channel that
they can be called on when the service needs to send out a notification.

You could also do this using interfaces, or events (passing a
MarshalByRefObject back to the service, returning an interface), but it
might get too messy to do.

As for parameters, you can pass anything you wish, as long as it is
either serializable, or derives from MarshalByRefObject, each providing
different semantics.

Hope this helps.
 
Back
Top