By Admin on Thursday, 28 May 2020
Category: All

RPC Progressive Results

WAMP 1.0 is an open WebSocket subprotocol that provides two asynchronous messaging patterns: RPC and PubSub.

From sgcWebSockets 4.3.8, a new method is supported, not included in WAMP 1.0 specification, but it can be very useful for our users. WAMP allows RPC calls, but server response can only be successful or not. Sometimes, an RPC requires more than one result (streaming news, quotes, show progress...) and here specification doesn't allow to do it (WAMP 2.0 it allows but is much more complex).

So, from sgcWebSockets 4.3.8, RPC with multiple results is available.

Basically it works equal than previous RPC, but there is a new Event in client side called OnCallProgressResult which is raised if server sends a partial result and there are still more results to be received. At the same time, server has a new method called CallProgressResult, which is called to send a partial result to client. 

Client can cancel an active RPC call, using the new method CancelCall and passing CallId as parameter.

Server Example 

Client Example 

Related Posts