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