P
Palvinder Singh
Hello google group peeps,
I am new to remoting, but have a grasp of it.
I am trying to create a server/client application, which will be
deployed over an intranet. I have upwards of five clients that connect
to a main server. The client application sets the state of several
switchs (on/off by means of clicking a button). When a switch is
turned on/off, its state is updated on the server, which will then
raise an event to update the other clients switchs to match each other.
i.e. if client A switches switch 3 on, client B, C, D etc... should
show that switch as on. Also I want to be able to check the status of
any switch, by means of checking its value stored on the server at any
given point.
The issue arises, as i think the best concept to use is server
activated, singleton and making it remotable by deriving from
MarshalByRefObject. From my research i found that Singleton is an
object that is instantiated and used by all connecting clients.
I have created a test application, which sets and gets a single value
(default value set to 0) that is stored on the server. When i set that
value to 10 on Client A and get the same value in Client B, Client B
comes back with 0. Client B should, in my thinking, come back with a
value of 10?
Am i mistaken in the way Singleton works and if so what should i be
using instead to maintain state of the switches on the server. Any
appropriate tutorials links would be great. I can also post source code
on request.
Any help appreciated
Regards
Palvinder
I am new to remoting, but have a grasp of it.
I am trying to create a server/client application, which will be
deployed over an intranet. I have upwards of five clients that connect
to a main server. The client application sets the state of several
switchs (on/off by means of clicking a button). When a switch is
turned on/off, its state is updated on the server, which will then
raise an event to update the other clients switchs to match each other.
i.e. if client A switches switch 3 on, client B, C, D etc... should
show that switch as on. Also I want to be able to check the status of
any switch, by means of checking its value stored on the server at any
given point.
The issue arises, as i think the best concept to use is server
activated, singleton and making it remotable by deriving from
MarshalByRefObject. From my research i found that Singleton is an
object that is instantiated and used by all connecting clients.
I have created a test application, which sets and gets a single value
(default value set to 0) that is stored on the server. When i set that
value to 10 on Client A and get the same value in Client B, Client B
comes back with 0. Client B should, in my thinking, come back with a
value of 10?
Am i mistaken in the way Singleton works and if so what should i be
using instead to maintain state of the switches on the server. Any
appropriate tutorials links would be great. I can also post source code
on request.
Any help appreciated
Regards
Palvinder