Like RPC Client, servers are top-level instances that most user code should interact with. They provide runnable functions that are combined with transports, protocols and dispatchers to form a complete RPC system.
RPCServer(transport, protocol, dispatcher)¶
High level RPC server.
Handle a single request.
Polls the transport for a new message.
After a new message has arrived
_spawn()is called with a handler function and arguments to handle the request.
The handler function will try to decode the message using the supplied protocol, if that fails, an error response will be sent. After decoding the message, the dispatcher will be asked to handle the resultung request and the return value (either an error or a result) will be sent back to the client using the transport.