[fpc-pascal] JSON RPC send server request to client

Wayne Sherman wsherman at gmail.com
Sun Oct 2 21:12:40 CEST 2022


Wayne wrote:
> JSON-RPC can be used bi-directionally when using
> UNIX domain sockets, TCP sockets, and other
> bidirectional transports (e.g websockets).
> If implemented as such using a bi-direction transport,
> the endpoints can be both a server and a client
> at the same time...

Sorry, my use of the term "bi-directional" is not really correct.
JSON-RPC is generally a bi-directional protocol (except when sending a
"notification").  The issue is that some bi-directional transports
(e.g. HTTP) close the connection after a response.  So for these types
of transports, a "server" cannot become a "client" since the
connection has been closed.

But if JSON-RPC is implemented using a transport which maintains (or
keeps open) a bi-directional connection, then either endpoint can
issue requests during the session if so desired. (i.e. either side can
be a server or a client at any point during the session).


More information about the fpc-pascal mailing list