Function registerWebRPC
Registers a route for handling incoming WebRPC requests.
void registerWebRPC(I)
(
URLRouter router,
string path,
I implementation,
WebRPCPeerCallback!I peer_callback
)
if (is(I == interface));
The endpoint defined by path
will attempt to establish a WebSocket
connection with the client and subsequently enables bi-directional
communication by listening for calls made by the client, as well as invoking
the peer_callback
to allow the server to make calls, too.
Parameters
Name | Description |
---|---|
router | The URLRouter on which to register the endpoint |
path | Path of the registered endpoint |
implementation | The API implementation to invoke for incoming method calls |
peer_callback | Callback invoked for each incoming connection |