Remote Procedure Call (Remote Procedure Call) is built on a socket, and runs the main program on a machine out of a desire for comparison, you can call a subroutine prepared on another machine, just like LPC (local process call ). The lower the layer, the more complex the code, the higher the flexibility, and the higher the efficiency. The higher the layer, the better the abstract encapsulation, the simpler the code, and the worse the efficiency. The difference between socket and RPC illustrates this again. ------ From below: http://johnyan.hostzi.com/phpbb3/viewtopic.php? T = 1305 ------ When programmers write programs based on C/S (client servers) and network engineers handle RPC problems, what are the differences and connections between RPC and socket? Remote Procedure Call (Remote Procedure Call) is built on a socket, and runs the main program on a machine out of a desire for comparison, you can call a subroutine prepared on another machine, just like LPC (local process call ). RPC provides a simple and reliable way to develop C/S programs. It describes data through a data expression method called XDR, and programmers write pseudocode, then, the rpcgen program is translated into the real C language source code that can be compiled, and then compiled into the real client and server programs. As a common C/S development method, RPC is efficient and reliable. however, the basic principle of RPC is to ignore the details of communication with the simplicity of module calls, so that programmers do not have to worry about the communication protocols between C/S and concentrate on the implementation process. this determines that the communication package generated by RPC cannot have the most appropriate solution for each application. Compared with the socket method, RPC occupies more network bandwidth by transmitting the same valid data. RPC is implemented on the basis of socket, which requires more network and system resources than socket. in addition, while programmers can directly modify the puzzling source program generated by rpcgen during program optimization, the simplicity of RPC, which pursues program design efficiency, is greatly reduced. Comparison between RPC and Socket Each of the two bosses has a Secretary responsible for connecting to MSN. the two secretaries are the Session Layer communication established based on the RPC protocol. the old man does not need to know how to use MSN. As long as he tells the Secretary, the Secretary will establish a session request and response with the other party through MSN. for socket-based communication, the boss needs to use MSN. In this way, even though the boss needs to train MSN's simple usage knowledge in advance, it is more efficient to communicate with the other party without passing through the secretary. |