When the. net1.0 version is released, WebService is basically used for remote calls. With the emergence of. net2.0, we can use a more convenient and highly scalable framework to compile remote calling programs, that is, we are all familiar with. netremoting.
There are countless articles on the. netremoting technology on the Internet, but few of them have a comprehensive and systematic learning book. We are all slowly exploring from scattered knowledge, and the effect is not ideal.
Today, I will also give a brief introduction to remoting that I understand. I don't know how powerful it is. It's a fully managed platform, highly scalable, and flexible. The framework fully adopts interface-oriented programming. we can provide our own implementation for any point, such as channel, formatter, lease, and publisher. The system reserves an Extended Interface for us. [Wang qingpei has all rights reserved. For more information, please sign it.]
In my ". Net brief introduction to component programming (appdomain application domain)" chapter, I briefly introduced the concept of. Net hosted runtime environment application domain (appdomain. Any access across application domains. net, whether it is two application domains in the same process or two application domains in two processes on one PC, it also spans two application domains of the network ,. net is called by proxy.
In fact, the interaction between two application domains in a process is relatively simple. When we create a new appdomain object in the default application domain, you only need to instantiate an appdomian and then create an objref using the createrefobject method of externalbyrefobject to bring all the information required by the proxy of the new application domain to the client application domain, because appdomain is also derived from the marshalbyrefobject class. Subsequent operations are called through a proxy. All objects created in the domain cannot be run. They can only be sent by value or by reference.
The two application domains in the same process share a physical space, and the thread is the physical execution unit of the path. During CPU execution, No matter what domain you are in, you can directly traverse it. So if we use threads in the same process for processing, we don't need to care about the concept of the application domain, but there are many potential threats, for example, context Security and component services must strictly control the call chain. In component services, context blocking is used to call services. Therefore, thread traversal is not recommended. For more information, see. NET Enterprise Service related technologies. [Wang qingpei has all rights reserved. For more information, please sign it.]
However, cross-process or cross-network remote calls are not that easy. Of course, this is not simple and we don't have to worry about it. NET is ready for us. We try to analyze which technologies will be involved if we want to call them remotely, so that we can learn independently.
Let's imagine that ,. net hosted objects are all hosted in physical processes. to communicate between different processes, the operating system provides us with IPC technology. To communicate with processes between different networks, the operating system provides us with a socket. If an application domain in a process wants to call the objects in the application domain in another process, it must be carried by the physical process, that is, it involves the call of IPC. If the application domain in one process in one network wants to call the objects in the application domain in the process in another network, we must use the socket technology provided by the operating system. [Any high-level application is built on the underlying layer]
Calls between the same machine:
Calls between different machines:
The above two images are basically the call process between objects. It seems complicated, but. Net has developed a unified remote processing framework for us. netremoting. We only need simple configuration to make it easy for the process to call remotely. [Wang qingpei has all rights reserved. For more information, please sign it.]
This article is. the beginning of netremoting does not involve many remoting technologies, but the content in this article is exactly the type of remoting implementation, remoting can be used well only after we have understood these relationships clearly.