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

Function StartIPCEndpoint

api/rpc/endpoints.go:86–102  ·  view source on GitHub ↗

StartIPCEndpoint starts an IPC endpoint.

(ipcEndpoint string, apis []API)

Source from the content-addressed store, hash-verified

84
85// StartIPCEndpoint starts an IPC endpoint.
86func StartIPCEndpoint(ipcEndpoint string, apis []API) (net.Listener, *Server, error) {
87 // Register all the APIs exposed by the services.
88 handler := NewServer()
89 for _, api := range apis {
90 if err := handler.RegisterName(api.Namespace, api.Service); err != nil {
91 return nil, nil, err
92 }
93 log.Debug("IPC registered", "namespace", api.Namespace)
94 }
95 // All APIs registered, start the IPC listener.
96 listener, err := ipcListen(ipcEndpoint)
97 if err != nil {
98 return nil, nil, err
99 }
100 go handler.ServeListener(listener)
101 return listener, handler, nil
102}

Callers

nothing calls this directly

Calls 5

RegisterNameMethod · 0.95
ServeListenerMethod · 0.95
NewServerFunction · 0.85
DebugMethod · 0.80
ipcListenFunction · 0.70

Tested by

no test coverage detected