RPC 和浏览器/服务器有什么区别?

发布于 2024-12-03 10:52:31 字数 97 浏览 2 评论 0原文

看来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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一梦浮鱼 2024-12-10 10:52:31

这些是松散相关的概念。 “浏览器/服务器”(通常称为客户端/服务器)表示一种架构,其中有一个进程侦听请求(服务器)和进程发出请求(客户端)。客户端可能会也可能不会使用 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.

皇甫轩 2024-12-10 10:52:31

不过,还需要考虑一些差异:

  1. RPC 使用存根。客户端调用“客户端存根”,而“客户端存根”又调用“服务器存根”来调用该过程。如果您谈论浏览器服务器,有时也会实现 RPC (RMI) 技术来达到相同的效果。

  2. 另外,调用的一个缺点是,RPC的调用不是面向连接的。客户端不知道该过程是否实际被调用。因此,如果出现不可预测的网络问题,它可能会失败。
    此外,浏览器技术是可靠的,因为它确认(如果实现)服务器中进程的执行(使用 AJAX 等)。

There are a few differences also to be considered though:

  1. 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.

  2. 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.).

栖竹 2024-12-10 10:52:31

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文