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

Method dialContext

coderd/tailnet.go:265–283  ·  view source on GitHub ↗
(ctx context.Context, network, addr string)

Source from the content-addressed store, hash-verified

263}
264
265func (s *ServerTailnet) dialContext(ctx context.Context, network, addr string) (net.Conn, error) {
266 agentID, ok := ctx.Value(agentIDKey{}).(uuid.UUID)
267 if !ok {
268 return nil, xerrors.Errorf("no agent id attached")
269 }
270
271 nc, err := s.DialAgentNetConn(ctx, agentID, network, addr)
272 if err != nil {
273 return nil, err
274 }
275
276 s.connsPerAgent.WithLabelValues("tcp").Inc()
277 s.totalConns.WithLabelValues("tcp").Inc()
278 return &instrumentedConn{
279 Conn: nc,
280 agentID: agentID,
281 connsPerAgent: s.connsPerAgent,
282 }, nil
283}
284
285func (s *ServerTailnet) AgentConn(ctx context.Context, agentID uuid.UUID) (workspacesdk.AgentConn, func(), error) {
286 var (

Callers

nothing calls this directly

Calls 4

DialAgentNetConnMethod · 0.95
WithLabelValuesMethod · 0.80
ValueMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected