@Test public void testTCPv6Netid() throws UnknownHostException { InetAddress address = InetAddress.getByName("fe80::21c:c0ff:fea0:caf4"); assertEquals("invalid netid", "tcp6", InetSocketAddresses.tcpNetidOf(address)); }
public static String tcpNetidOf(InetAddress address) { if (address instanceof Inet4Address) { return "tcp"; } else if (address instanceof Inet6Address) { return "tcp6"; } throw new IllegalArgumentException("unsupported inet type: " + address.getClass().getName()); }
InetSocketAddresses { public static String tcpNetidOf(InetAddress address) { if (address instanceof Inet4Address) { return "tcp"; } else if (address instanceof Inet6Address) { return "tcp6"; } throw new IllegalArgumentException("unsupported inet type: " + address.getClass().getName()); } }
InetSocketAddresses { public static String tcpNetidOf(InetAddress address) { if (address instanceof Inet4Address) { return "tcp"; } else if (address instanceof Inet6Address) { return "tcp6"; } throw new IllegalArgumentException("unsupported inet type: " + address.getClass().getName()); } private  InetSocketAddresses(); }
InetSocketAddresses { public static String tcpNetidOf(InetAddress address) { if (address instanceof Inet4Address) { return "tcp"; } else if (address instanceof Inet6Address) { return "tcp6"; } throw new IllegalArgumentException("unsupported inet type: " + address.getClass().getName()); } private  InetSocketAddresses(); static InetSocketAddress forUaddrString(String uaddr); static InetSocketAddress inetAddressOf(String address); static String uaddrOf(InetSocketAddress socketAddress); static String uaddrOf(String host, int port); static String tcpNetidOf(InetAddress address); }
InetSocketAddresses { public static String tcpNetidOf(InetAddress address) { if (address instanceof Inet4Address) { return "tcp"; } else if (address instanceof Inet6Address) { return "tcp6"; } throw new IllegalArgumentException("unsupported inet type: " + address.getClass().getName()); } private  InetSocketAddresses(); static InetSocketAddress forUaddrString(String uaddr); static InetSocketAddress inetAddressOf(String address); static String uaddrOf(InetSocketAddress socketAddress); static String uaddrOf(String host, int port); static String tcpNetidOf(InetAddress address);  }