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

Function testOrDefaultDialer

cli/ssh.go:1678–1688  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

1676}
1677
1678func testOrDefaultDialer(ctx context.Context) coderConnectDialer {
1679 dialer, ok := ctx.Value(coderConnectDialerContextKey{}).(coderConnectDialer)
1680 if !ok || dialer == nil {
1681 // Timeout prevents hanging on broken tunnels (OS default is very long).
1682 return &net.Dialer{
1683 Timeout: 5 * time.Second,
1684 KeepAlive: 30 * time.Second,
1685 }
1686 }
1687 return dialer
1688}
1689
1690func runCoderConnectStdio(ctx context.Context, addr string, stdin io.Reader, stdout io.Writer, stack *closerStack, logger slog.Logger) error {
1691 dialer := testOrDefaultDialer(ctx)

Calls 1

ValueMethod · 0.45