August 2002
Intermediate to advanced
576 pages
13h 54m
English
In common with RMI, remoting provides the distinction between classes that will be referenced remotely and classes that will be copied across the network via serialization. In the example, the CountState class is annotated with the Serializable attribute, indicating that it will be copied and sent to the client as the result of a call to the CountServer.SumNumbers method; all of the .NET primitive types are annotated with the Serializable attribute. We can see the effect of serialization if we modify the CountClient.DoRemoteSummation method:
private void DoRemoteSummation(CountServer p_server) { for (int i = 0; i < 2; i++) { // clear the state total Console.WriteLine("Clearing state."); p_server.State.Clear(); // send some ...Read now
Unlock full access