MCPcopy Index your code
hub / github.com/subtrace/subtrace / Close

Method Close

cmd/run/socket/proxy.go:70–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68}
69
70func (p *proxy) Close() error {
71 errs := make(chan error, 2)
72
73 go func() {
74 if p.process == nil {
75 errs <- nil
76 return
77 }
78 switch err := p.process.Close(); {
79 case err == nil:
80 case errors.Is(err, net.ErrClosed):
81 default:
82 errs <- fmt.Errorf("close process side: %w", err)
83 return
84 }
85 errs <- nil
86 }()
87
88 go func() {
89 if p.external == nil {
90 errs <- nil
91 return
92 }
93 switch err := p.external.Close(); {
94 case err == nil:
95 case errors.Is(err, net.ErrClosed):
96 default:
97 errs <- fmt.Errorf("close external side: %w", err)
98 return
99 }
100 errs <- nil
101 }()
102
103 return errors.Join(<-errs, <-errs)
104}
105
106func (p *proxy) LogValue() slog.Value {
107 process := slog.String("process", "<nil>")

Callers 15

startMethod · 0.95
getExecutableHashInnerFunction · 0.45
dumpLocalMethod · 0.45
runMethod · 0.45
dialWebsocketFunction · 0.45
entrypointParentMethod · 0.45
forkChildMethod · 0.45
entrypointChildMethod · 0.45
loopMethod · 0.45
proxyHTTP1Method · 0.45
cleanupMethod · 0.45
decompressMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected