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

Function handleJobDomainSocketClient

pkg/jobmanager/jobmanager.go:414–447  ·  view source on GitHub ↗
(conn net.Conn)

Source from the content-addressed store, hash-verified

412}
413
414func handleJobDomainSocketClient(conn net.Conn) {
415 inputCh := make(chan baseds.RpcInputChType, wshutil.DefaultInputChSize)
416 outputCh := make(chan []byte, wshutil.DefaultOutputChSize)
417
418 serverImpl := &MainServerConn{
419 Conn: conn,
420 inputCh: inputCh,
421 }
422 rpcCtx := wshrpc.RpcContext{}
423 wshRpc := wshutil.MakeWshRpcWithChannels(inputCh, outputCh, rpcCtx, serverImpl, "job-domain")
424 serverImpl.WshRpc = wshRpc
425 defer WshCmdJobManager.disconnectFromStreamHelper(serverImpl)
426
427 go func() {
428 defer func() {
429 panichandler.PanicHandler("handleJobDomainSocketClient:AdaptOutputChToStream", recover())
430 }()
431 defer serverImpl.Close()
432 writeErr := wshutil.AdaptOutputChToStream(outputCh, conn)
433 if writeErr != nil {
434 log.Printf("error writing to domain socket: %v\n", writeErr)
435 }
436 }()
437
438 go func() {
439 defer func() {
440 panichandler.PanicHandler("handleJobDomainSocketClient:AdaptStreamToMsgCh", recover())
441 }()
442 defer serverImpl.Close()
443 wshutil.AdaptStreamToMsgCh(conn, inputCh, nil)
444 }()
445
446 _ = wshRpc
447}

Callers 1

MakeJobDomainSocketFunction · 0.85

Calls 6

CloseMethod · 0.95
MakeWshRpcWithChannelsFunction · 0.92
PanicHandlerFunction · 0.92
AdaptOutputChToStreamFunction · 0.92
AdaptStreamToMsgChFunction · 0.92

Tested by

no test coverage detected