MCPcopy Index your code
hub / github.com/coder/coder / acceptLoop

Method acceptLoop

agent/boundarylogproxy/proxy.go:124–141  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

122}
123
124func (s *Server) acceptLoop(ctx context.Context) {
125 defer s.wg.Done()
126
127 for {
128 conn, err := s.listener.Accept()
129 if err != nil {
130 if ctx.Err() != nil {
131 s.logger.Warn(ctx, "accept loop terminated", slog.Error(ctx.Err()))
132 return
133 }
134 s.logger.Warn(ctx, "socket accept error", slog.Error(err))
135 continue
136 }
137
138 s.wg.Add(1)
139 go s.handleConnection(ctx, conn)
140 }
141}
142
143func (s *Server) handleConnection(ctx context.Context, conn net.Conn) {
144 defer s.wg.Done()

Callers 1

StartMethod · 0.95

Calls 6

handleConnectionMethod · 0.95
ErrMethod · 0.80
AddMethod · 0.65
DoneMethod · 0.45
AcceptMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected