MCPcopy
hub / github.com/tailscale/tailscale / Dial

Method Dial

control/controlhttp/http_test.go:847–862  ·  view source on GitHub ↗
(ctx context.Context, network, addr string)

Source from the content-addressed store, hash-verified

845}
846
847func (d *memnetDialer) Dial(ctx context.Context, network, addr string) (net.Conn, error) {
848 conn, err := d.inner(ctx, network, addr)
849 if err != nil {
850 return nil, err
851 }
852
853 d.mu.Lock()
854 if d.conns == nil {
855 d.conns = make(map[net.Conn]string)
856 }
857 d.conns[conn] = conn.RemoteAddr().String()
858 d.t.Logf("tracked connection opened to %s", conn.RemoteAddr())
859 d.mu.Unlock()
860
861 return &memnetTrackedConn{Conn: conn, dialer: d}, nil
862}
863
864func (d *memnetDialer) waitForAllClosedSynctest() {
865 const maxWait = 15 * time.Second

Callers

nothing calls this directly

Calls 5

LockMethod · 0.65
StringMethod · 0.65
RemoteAddrMethod · 0.65
LogfMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected