MCPcopy Create free account
hub / github.com/CPChain/chain / NewServer

Function NewServer

api/rpc/server.go:46–59  ·  view source on GitHub ↗

NewServer will create a new server instance with no registered handlers.

()

Source from the content-addressed store, hash-verified

44
45// NewServer will create a new server instance with no registered handlers.
46func NewServer() *Server {
47 server := &Server{
48 services: make(serviceRegistry),
49 codecs: set.New(),
50 run: 1,
51 }
52
53 // register a default service which will provide meta information about the RPC service such as the services and
54 // methods it offers.
55 rpcService := &RPCService{server}
56 server.RegisterName(MetadataApi, rpcService)
57
58 return server
59}
60
61// RPCService gives meta information about the server.
62// e.g. gives information about the loaded modules.

Callers 9

TestServerRegisterNameFunction · 0.85
newTestServerFunction · 0.85
TestNotificationsFunction · 0.85
TestJSONRequestParsingFunction · 0.85
StartHTTPEndpointFunction · 0.85
StartWSEndpointFunction · 0.85
StartIPCEndpointFunction · 0.85

Calls 1

RegisterNameMethod · 0.95

Tested by 6

TestServerRegisterNameFunction · 0.68
newTestServerFunction · 0.68
TestNotificationsFunction · 0.68
TestJSONRequestParsingFunction · 0.68