callFunction

abstract suspend fun callFunction(methodId: Int, message: ByteString): ByteString

When called by the generated service client proxy implementation it calls the remote method with the specified methodId and the specified message as method call arguments. A ByteString should be returned as return value for the method call. If the remote call cannot be completed it fails by throwing a CancellationException.

For generated service handler implementations, provided by service stubs, you can call this to cause the method with the specified methodId to be called on the stub object, with the specified message as arguments. The return value of the called stub method will be returned by this function.