Both types are server-activated objects.
<? XML version = "1.0" encoding = "UTF-8"?>
<Configuration>
<System. runtime. remoting>
<Application name = "simpleserver">
<Service>
<Wellknown mode = "singlecall" type = "simremote1.remoteobject, simremote1" objecturi = "remoteobject">
</Service>
<Channels>
<Channel ref = "TCP server" Port = "8080"/>
</Channels>
</Application>
</System. runtime. remoting>
</Configuration>
Client configuration file
<? XML version = "1.0" encoding = "UTF-8"?>
<Configuration> <system. runtime. remoting>
<Application name = "simpleclient">
<Client URL> // The original <client url = "TCP: // localhost: 8080/simpleserver">
// <Activated type = "simremote1.remoteobject, simremote1"/>
<Wellknown type = "simremote1.remoteobject, simremote1" url = "TCP: // localhost: 8080/simpleserver/remoteobject"/>
</Client>
<Channels>
<Channel ref = "tcp client"/>
</Channels>
</Application>
</System. runtime. remoting>
</Configuration>
An independent call object is created when the call starts and released when the call ends. Ensure that valuable memory is not occupied for a long time. The client can retain reference to the object proxy at any time. The proxy creates a remote object based on each call.
The called object is stateless.
For example, create a server object to read a large amount of data from the database and provide aggregated information to the client (the client may use a slow Internet connection, and the raw data is very large .), In this case, you need a client object or a separate object to obtain data. Otherwise, you must query the database again for each remote object called by the method.
Independent object
A single object is in the same state as a client activation object. But it is created by a server.
Mode = "Singleton"
The client configuration of a single object is the same as that of a single called object.