MCPcopy
hub / github.com/wavetermdev/waveterm / setupConnServerRpcClientWithRouter

Function setupConnServerRpcClientWithRouter

cmd/wsh/cmd/wshcmd-connserver.go:186–200  ·  view source on GitHub ↗
(router *wshutil.WshRouter, sockName string)

Source from the content-addressed store, hash-verified

184}
185
186func setupConnServerRpcClientWithRouter(router *wshutil.WshRouter, sockName string) (*wshutil.WshRpc, string, error) {
187 routeId := wshutil.MakeConnectionRouteId(connServerConnName)
188 rpcCtx := wshrpc.RpcContext{
189 RouteId: routeId,
190 Conn: connServerConnName,
191 }
192
193 bareRouteId := wshutil.MakeRandomProcRouteId()
194 bareClient := wshutil.MakeWshRpc(wshrpc.RpcContext{}, &wshclient.WshServer{}, bareRouteId)
195 router.RegisterTrustedLeaf(bareClient, bareRouteId)
196
197 connServerClient := wshutil.MakeWshRpc(rpcCtx, wshremote.MakeRemoteRpcServerImpl(os.Stdout, router, bareClient, false, connServerInitialEnv, sockName), routeId)
198 router.RegisterTrustedLeaf(connServerClient, routeId)
199 return connServerClient, routeId, nil
200}
201
202func serverRunRouter() error {
203 log.Printf("starting connserver router")

Callers 2

serverRunRouterFunction · 0.85

Calls 5

MakeConnectionRouteIdFunction · 0.92
MakeRandomProcRouteIdFunction · 0.92
MakeWshRpcFunction · 0.92
MakeRemoteRpcServerImplFunction · 0.92
RegisterTrustedLeafMethod · 0.80

Tested by

no test coverage detected