RpcServer interface represents an RPC server, that accepts RPC messages and may contain multiple services to route to. RpcServer uses data from incoming RPC messages and routes it to the designated service and sends service's response back to the corresponding client.
You can provide your own RpcServer implementation or use the one provided out of the box. Note that client and server must use the same RPC protocol to communicate.
Use registerService function to add your own factory for implemented RPC services:
val server: RpcServer
server.registerService<MyService>{MyServiceImpl()}
note
The registerService function requires the explicit type of the declared RPC service. That means that the code will not work if you provide it with the type of the service implementation:
// Wrong! Should be `MyService` as type argument
server.registerService<MyServiceImpl>{MyServiceImpl()}