MCPcopy Index your code
hub / github.com/tailscale/tailscale / DialContextTCP

Method DialContextTCP

wgengine/netstack/netstack.go:948–962  ·  view source on GitHub ↗
(ctx context.Context, ipp netip.AddrPort)

Source from the content-addressed store, hash-verified

946}
947
948func (ns *Impl) DialContextTCP(ctx context.Context, ipp netip.AddrPort) (*gonet.TCPConn, error) {
949 remoteAddress := tcpip.FullAddress{
950 NIC: nicID,
951 Addr: tcpip.AddrFromSlice(ipp.Addr().AsSlice()),
952 Port: ipp.Port(),
953 }
954 var ipType tcpip.NetworkProtocolNumber
955 if ipp.Addr().Is4() {
956 ipType = ipv4.ProtocolNumber
957 } else {
958 ipType = ipv6.ProtocolNumber
959 }
960
961 return gonet.DialContextTCP(ctx, ns.ipstack, remoteAddress, ipType)
962}
963
964// DialContextTCPWithBind creates a new gonet.TCPConn connected to the specified
965// remoteAddress with its local address bound to localAddr on an available port.

Callers 2

newNetstackFunction · 0.80
newIPNFunction · 0.80

Calls 3

AsSliceMethod · 0.45
AddrMethod · 0.45
PortMethod · 0.45

Tested by

no test coverage detected