(ctx context.Context, ipp netip.AddrPort)
| 983 | } |
| 984 | |
| 985 | func (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. |
no test coverage detected