First, let me tell you a little about my setup. My server is configured as a single Marshaled object:
RemotingServices.Marshal(lsServer, ServerObject.objectUri);
To have two-way communication with the server with the client, the client activates ServerObject, and then goes to its own ClientObject (which is also MarshalByRefObject), the server uses ClientObject to talk to the client:
var lsClient = new ClientObject();
var lsServer = (ServerObject)Activator.GetObject(typeof(ServerObject), url);
lsServer.attach(lsClient);
When the attach method is called, the server takes the ClientObject and stores it in the list:
public void attach(ClientObject client) {
clientList.Add(client);
}
Then, the server can call a method in ClientObject called "SendMessage" to communicate with each client in its list:
foreach(var c in clientList) {
c.SendMessage("Hello");
}
, , . , . , , ClientObject . " " , :
clientList.Remove(badClient);
, :
1 ?
2- , , , "" ( ?)
, , List ( .Equals) - ClientObject , , .
, , , . , .
, , .