(conn net.Conn)
| 412 | } |
| 413 | |
| 414 | func 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 | } |
no test coverage detected