StartIPCEndpoint starts an IPC endpoint.
(ipcEndpoint string, apis []API)
| 84 | |
| 85 | // StartIPCEndpoint starts an IPC endpoint. |
| 86 | func 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 | } |
nothing calls this directly
no test coverage detected