jsonrpc_server.go 444 B

12345678910111213141516171819202122
  1. package jsonrpclite
  2. type rpcServer struct {
  3. engine RpcServerEngine
  4. }
  5. //Start the server with the router.
  6. func (server *rpcServer) Start(router *rpcRouter) {
  7. server.engine.Start(router)
  8. }
  9. //Stop the server
  10. func (server *rpcServer) Stop() {
  11. server.engine.Stop()
  12. }
  13. // NewRpcServer Create a new rpc server with engine.
  14. func NewRpcServer(engine RpcServerEngine) *rpcServer {
  15. server := new(rpcServer)
  16. server.engine = engine
  17. return server
  18. }