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

Method DialContextUDP

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

Source from the content-addressed store, hash-verified

983}
984
985func (ns *Impl) DialContextUDP(ctx context.Context, ipp netip.AddrPort) (*gonet.UDPConn, error) {
986 remoteAddress := &tcpip.FullAddress{
987 NIC: nicID,
988 Addr: tcpip.AddrFromSlice(ipp.Addr().AsSlice()),
989 Port: ipp.Port(),
990 }
991 var ipType tcpip.NetworkProtocolNumber
992 if ipp.Addr().Is4() {
993 ipType = ipv4.ProtocolNumber
994 } else {
995 ipType = ipv6.ProtocolNumber
996 }
997
998 return gonet.DialUDP(ns.ipstack, nil, remoteAddress, ipType)
999}
1000
1001// DialContextUDPWithBind creates a new gonet.UDPConn. Connected to remoteAddr.
1002// 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