MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / SetupPacketRpcClient

Function SetupPacketRpcClient

pkg/wshutil/wshutil.go:137–152  ·  view source on GitHub ↗
(input io.Reader, output io.Writer, serverImpl ServerImpl, debugStr string)

Source from the content-addressed store, hash-verified

135}
136
137func SetupPacketRpcClient(input io.Reader, output io.Writer, serverImpl ServerImpl, debugStr string) (*WshRpc, chan []byte) {
138 messageCh := make(chan baseds.RpcInputChType, DefaultInputChSize)
139 outputCh := make(chan []byte, DefaultOutputChSize)
140 rawCh := make(chan []byte, DefaultOutputChSize)
141 rpcClient := MakeWshRpcWithChannels(messageCh, outputCh, wshrpc.RpcContext{}, serverImpl, debugStr)
142 go packetparser.Parse(input, messageCh, rawCh)
143 go func() {
144 defer func() {
145 panichandler.PanicHandler("SetupPacketRpcClient:outputloop", recover())
146 }()
147 for msg := range outputCh {
148 packetparser.WritePacket(output, msg)
149 }
150 }()
151 return rpcClient, rawCh
152}
153
154func SetupConnRpcClient(conn net.Conn, serverImpl ServerImpl, debugStr string) (*WshRpc, chan error, error) {
155 inputCh := make(chan baseds.RpcInputChType, DefaultInputChSize)

Callers

nothing calls this directly

Calls 4

ParseFunction · 0.92
PanicHandlerFunction · 0.92
WritePacketFunction · 0.92
MakeWshRpcWithChannelsFunction · 0.85

Tested by

no test coverage detected