RPC 和浏览器/服务器有什么区别?
看来Browser/Server和RPC一样,都是Browser向Server发送请求,
Server调用相关例程后返回数据。
那么有什么区别呢?
It seems Browser/Server is the same as RPC in that the Browser sends a request to the Server,
and the Server returns the data after calling related routines.
So what's the difference?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这些是松散相关的概念。 “浏览器/服务器”(通常称为客户端/服务器)表示一种架构,其中有一个进程侦听请求(服务器)和进程发出请求(客户端)。客户端可能会也可能不会使用 RPC 机制来调用服务器。例如,HTTP 是一种客户端/服务器协议,不被视为 RPC。
RPC是Remote procedure Call的缩写,意思是客户端调用代理对象上的方法,代理对象向服务器发送请求。然后,服务器将请求转换为对其目标对象的方法(过程)调用。因此,对于客户端来说,它看起来只是在服务器对象上调用一个方法,但客户端/服务器代码是实现这一点的。
Those are loosely related concepts. "Browser/Server" (usually named client/server) indicates an architecture where you have a process listening for requests (a server) and processes making requests (clients). The client may or may not be calling the server using an RPC mechanism. HTTP, for example, is a client/server protocol that is not considered RPC.
RPC means Remote Procedure Call, which means that the client calls a method on a proxy object, and the proxy object sends a request to the server. The server then translates the request into a method (procedure) call to its target object. Therefore to the client, it looks like it's simply calling a method on a server object, but client/server code is what enables this.
不过,还需要考虑一些差异:
RPC 使用存根。客户端调用“客户端存根”,而“客户端存根”又调用“服务器存根”来调用该过程。如果您谈论浏览器服务器,有时也会实现 RPC (RMI) 技术来达到相同的效果。
另外,调用的一个缺点是,RPC的调用不是面向连接的。客户端不知道该过程是否实际被调用。因此,如果出现不可预测的网络问题,它可能会失败。
此外,浏览器技术是可靠的,因为它确认(如果实现)服务器中进程的执行(使用 AJAX 等)。
There are a few differences also to be considered though:
RPC works with stubs. Client calls the 'client-stub' which in turns calls the 'server-stub' for the call of the procedure. If you talk about browser-server, also RPC (RMI) technology is implemented sometimes to achieve the same effect.
Additionally, to call a disadvantage, the call of RPC is not connection-oriented. The client does not know whether the procedure was actually-called. Thus it can be failure in case of unpredictable network problems.
Also the browser technology is reliable as it confirms (if implemented) the execution of the process in the server (using AJAX etc.).
Rpc 导致一个过程在远程过程中执行。
在客户端服务器中,该过程可以在本地主机或远程位置执行。
Rpc causes a procedure to execute in the remote procedure.
in client server the procedure may be execute in local host or remote location.