Home
last modified time | relevance | path

Searched refs:InetAddress (Results 1 – 25 of 97) sorted by relevance

1234

/libcore/luni/src/test/java/libcore/java/net/
DInetAddressTest.java21 import java.net.InetAddress;
71 return (Inet6Address) InetAddress.getByAddress(LOOPBACK6_BYTES); in loopback6()
75 return (Inet6Address) InetAddress.getByAddress("localhost", LOOPBACK6_BYTES); in localhost6()
80 assertEquals("/1.2.3.4", InetAddress.parseNumericAddress("1.2.3.4").toString()); in test_parseNumericAddress()
82 …assertEquals("/2001:4860:800d::68", InetAddress.parseNumericAddress("2001:4860:800d::68").toString… in test_parseNumericAddress()
84 assertEquals("/127.0.0.1", InetAddress.parseNumericAddress("::ffff:127.0.0.1").toString()); in test_parseNumericAddress()
86 …assertEquals("/2001:4860:800d::68", InetAddress.parseNumericAddress("[2001:4860:800d::68]").toStri… in test_parseNumericAddress()
87 … assertEquals("/127.0.0.1", InetAddress.parseNumericAddress("[::ffff:127.0.0.1]").toString()); in test_parseNumericAddress()
90 InetAddress.parseNumericAddress("example.com"); // Not numeric. in test_parseNumericAddress()
96 assertEquals("/177.0.0.1", InetAddress.parseNumericAddress("0177.00.00.01").toString()); in test_parseNumericAddress()
[all …]
DInetSocketAddressTest.java19 import java.net.InetAddress;
59 InetAddress ia = InetAddress.getByName(validIPAddresses[i]); in test_ConstructorLInetAddressI()
65 InetSocketAddress isa = new InetSocketAddress((InetAddress)null, 80); in test_ConstructorLInetAddressI()
69 new InetSocketAddress(InetAddress.getByName("localhost"), 65536); in test_ConstructorLInetAddressI()
75 new InetSocketAddress(InetAddress.getByName("localhost"), -1); in test_ConstructorLInetAddressI()
106 InetAddress localhost = InetAddress.getByName("localhost"); in test_equals()
121 InetAddress ia = InetAddress.getByName(validIPAddresses[i]); in test_getAddress()
125 InetSocketAddress isa = new InetSocketAddress((InetAddress) null, 0); in test_getAddress()
130 InetAddress localhost = InetAddress.getByName("localhost"); in test_hashCode()
155 InetAddress address = InetAddress.getByAddress(new byte[] { 127, 0, 0, 1 }); in test_getHostString()
DNetworkInterfaceTest.java22 import java.net.InetAddress;
35 Set<InetAddress> actual = new HashSet<InetAddress>(Collections.list(lo.getInetAddresses())); in testIPv6()
37 Set<InetAddress> expected = new HashSet<InetAddress>(); in testIPv6()
48 List<InetAddress> addresses = new ArrayList<InetAddress>(1); in test_collectIpv6Addresses_3digitInterfaceIndex()
64 List<InetAddress> addresses = new ArrayList<InetAddress>(1); in test_collectIpv6Addresses_skipsUnmatchedLines()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/
DInetAddressTest.java24 import java.net.InetAddress;
42 InetAddress.getByName("1.2.3.4hello"); in test_getByName_exceptionContainsUsefulMessage()
50 InetAddress ia1 = InetAddress.getByName("localhost"); in test_equalsLjava_lang_Object()
51 InetAddress ia2 = InetAddress.getByName("::1"); in test_equalsLjava_lang_Object()
61 InetAddress ia = InetAddress.getByName("127.0.0.1"); in test_getAddress()
70 InetAddress address = InetAddress.getByAddress(origBytes); in test_getAddress()
83 InetAddress[] all = InetAddress.getAllByName("localhost"); in test_getAllByNameLjava_lang_String()
87 for (InetAddress alias : all) { in test_getAllByNameLjava_lang_String()
94 InetAddress[] ias = InetAddress.getAllByName(null); in test_getAllByNameLjava_lang_String()
96 for (InetAddress ia : ias) { in test_getAllByNameLjava_lang_String()
[all …]
DInet6AddressTest.java22 import java.net.InetAddress;
34 InetAddress addr = null; in test_isMulticastAddress()
43 addr = InetAddress.getByName(addrName); in test_isMulticastAddress()
48 addr = InetAddress.getByName(addrName); in test_isMulticastAddress()
61 addr = InetAddress.getByName(addrName); in test_isMulticastAddress()
67 addr = InetAddress.getByName(addrName); in test_isMulticastAddress()
80 addr = InetAddress.getByName(addrName); in test_isMulticastAddress()
85 addr = InetAddress.getByName(addrName); in test_isMulticastAddress()
94 InetAddress addr = null; in test_isAnyLocalAddress()
98 addr = InetAddress.getByName(addrName); in test_isAnyLocalAddress()
[all …]
DInet4AddressTest.java22 import java.net.InetAddress;
40 InetAddress addr = InetAddress.getByName(addrName); in test_isMulticastAddress()
45 addr = InetAddress.getByName(addrName); in test_isMulticastAddress()
50 addr = InetAddress.getByName(addrName); in test_isMulticastAddress()
58 assertTrue(InetAddress.getByName("0.0.0.0").isAnyLocalAddress()); in test_isAnyLocalAddress()
59 assertFalse(InetAddress.getByName("127.0.0.1").isAnyLocalAddress()); in test_isAnyLocalAddress()
68 InetAddress addr = InetAddress.getByName(addrName); in test_isLoopbackAddress()
74 addr = InetAddress.getByName(addrName); in test_isLoopbackAddress()
80 addr = InetAddress.getByName(addrName); in test_isLoopbackAddress()
96 InetAddress addr = InetAddress.getByName(addrName); in test_isLinkLocalAddress()
[all …]
DNetworkInterfaceTest.java20 import java.net.InetAddress;
68 InetAddress theAddress = (InetAddress) theAddresses in test_getInetAddresses()
77 InetAddress theAddress = (InetAddress) theAddresses in test_getInetAddresses()
90 InetAddress theAddress = (InetAddress) addresses.nextElement(); in test_getInetAddresses()
100 InetAddress theAddress = (InetAddress) addresses in test_getInetAddresses()
112 InetAddress nextAddress = (InetAddress) reducedAddresses in test_getInetAddresses()
121 InetAddress nextAddress = (InetAddress) reducedAddresses in test_getInetAddresses()
136 InetAddress nextAddress = (InetAddress) reducedAddresses in test_getInetAddresses()
145 InetAddress nextAddress = (InetAddress) reducedAddresses in test_getInetAddresses()
162 .getByInetAddress((InetAddress) notOkAddresses in test_getInetAddresses()
[all …]
DDatagramPacketTest.java23 import java.net.InetAddress;
70 InetAddress.getLocalHost(), 0); in test_Constructor$BIILjava_net_InetAddressI()
71 assertEquals("Wrong host", InetAddress.getLocalHost(), dp.getAddress()); in test_Constructor$BIILjava_net_InetAddressI()
83 InetAddress.getLocalHost(), 0); in test_Constructor$BILjava_net_InetAddressI()
84 assertEquals("Wrong address", InetAddress.getLocalHost(), dp in test_Constructor$BILjava_net_InetAddressI()
95 InetAddress.getLocalHost(), 0); in test_getAddress()
96 assertEquals("Incorrect address returned", InetAddress.getLocalHost(), in test_getAddress()
130 InetAddress.getLocalHost(), 1000); in test_getPort()
133 final InetAddress localhost = InetAddress.getLocalHost(); in test_getPort()
151 InetAddress ia = InetAddress.getByName("127.0.0.1"); in test_setAddressLjava_net_InetAddress()
[all …]
DInetAddressThreadTest.java20 import java.net.InetAddress;
42 private InetAddress testAddress;
58 InetAddress testAddress, int type) { in threadsafeTestThread()
85 InetAddress ia = InetAddress.getByName(lookupName); in run()
134 InetAddress lookup1 = InetAddress.getByName("localhost"); in test_getHostName()
136 InetAddress lookup2 = InetAddress.getByName("localhost"); in test_getHostName()
DSocketTest.java26 import java.net.InetAddress;
162 InetSocketAddress bogusAddress = new InetSocketAddress(InetAddress in test_bindLjava_net_SocketAddress()
174 theSocket.bind(new InetSocketAddress(InetAddress.getLocalHost(), 0)); in test_bindLjava_net_SocketAddress()
180 new InetSocketAddress(InetAddress.getLocalHost(), portNumber), in test_bindLjava_net_SocketAddress()
185 InetSocketAddress theAddress = new InetSocketAddress(InetAddress in test_bindLjava_net_SocketAddress()
190 InetSocketAddress boundAddress = new InetSocketAddress(InetAddress in test_bindLjava_net_SocketAddress()
197 new InetSocketAddress(InetAddress.getLocalHost(), portNumber), in test_bindLjava_net_SocketAddress()
215 theAddress = new InetSocketAddress(InetAddress.getLocalHost(), 0); in test_bindLjava_net_SocketAddress()
249 InetAddress address = InetAddress.getByName("localhost"); in test_bindLjava_net_SocketAddress_Proxy()
260 Socket client = new Socket(InetAddress.getLocalHost(), server.getLocalPort()); in test_close()
[all …]
DDatagramSocketImplTest.java24 import java.net.InetAddress;
42 InetAddress localhost = InetAddress.getByName("localhost"); //$NON-NLS-1$ in test_connect()
60 protected void bind(int port, InetAddress addr) throws SocketException { in bind()
89 protected void join(InetAddress addr) throws IOException { in join()
100 protected void leave(InetAddress addr) throws IOException { in leave()
111 protected int peek(InetAddress sender) throws IOException { in peek()
145 public void test_connect(InetAddress inetAddr, int port) throws SocketException { in test_connect()
DServerSocketTest.java27 import java.net.InetAddress;
64 cs = new Socket(InetAddress.getLocalHost().getHostName(), port); in run()
156 s = new ServerSocket(0, 10, InetAddress.getLocalHost()); in test_ConstructorIILjava_net_InetAddress()
264 InetAddress addr = InetAddress.getLocalHost(); in test_getInetAddress()
384 InetSocketAddress theAddress = new InetSocketAddress(InetAddress in test_bindLjava_net_SocketAddress()
392 + (new InetSocketAddress(InetAddress.getLocalHost(), in test_bindLjava_net_SocketAddress()
395 new InetSocketAddress(InetAddress in test_bindLjava_net_SocketAddress()
403 InetSocketAddress clAddress = new InetSocketAddress(InetAddress in test_bindLjava_net_SocketAddress()
423 theAddress = new InetSocketAddress(InetAddress.getLocalHost(), 0); in test_bindLjava_net_SocketAddress()
437 theSocket.bind(new InetSocketAddress(InetAddress in test_bindLjava_net_SocketAddress()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/
DSocketFactoryTest.java26 import java.net.InetAddress;
63 Socket s = sf.createSocket(InetAddress.getLocalHost().getHostName(), sport); in test_createSocket_StringI()
75 sf.createSocket(InetAddress.getLocalHost().getHostName(), invalidPorts[i]); in test_createSocket_StringI()
82 sf.createSocket(InetAddress.getLocalHost().getHostName(), s.getLocalPort()); in test_createSocket_StringI()
89 f.createSocket(InetAddress.getLocalHost().getHostName(), 8082); in test_createSocket_StringI()
100 Socket s = sf.createSocket(InetAddress.getLocalHost(), sport); in test_createSocket_InetAddressI()
106 sf.createSocket(InetAddress.getLocalHost(), invalidPorts[i]); in test_createSocket_InetAddressI()
113 sf.createSocket(InetAddress.getLocalHost(), s.getLocalPort()); in test_createSocket_InetAddressI()
120 f.createSocket(InetAddress.getLocalHost(), 8081); in test_createSocket_InetAddressI()
131 Socket s = sf.createSocket(InetAddress.getLocalHost(), sport, in test_createSocket_InetAddressIInetAddressI()
[all …]
/libcore/luni/src/main/java/java/net/
DInetAddress.java124 public class InetAddress implements Serializable { class
143 public static final InetAddress UNSPECIFIED = new InetAddress(AF_UNSPEC, null, null);
150 InetAddress(int family, byte[] ipaddress, String hostName) { in InetAddress() method in InetAddress
167 if (!(obj instanceof InetAddress)) { in equals()
170 return Arrays.equals(this.ipaddress, ((InetAddress) obj).ipaddress); in equals()
192 private static InetAddress[] bytesToInetAddresses(byte[][] rawAddresses, String hostName) in bytesToInetAddresses()
195 InetAddress[] returnedAddresses = new InetAddress[rawAddresses.length]; in bytesToInetAddresses()
214 public static InetAddress[] getAllByName(String host) throws UnknownHostException { in getAllByName()
228 …public static InetAddress[] getAllByNameOnNet(String host, int netId) throws UnknownHostException { in getAllByNameOnNet()
237 …private static InetAddress[] getAllByNameImpl(String host, int netId) throws UnknownHostException { in getAllByNameImpl()
[all …]
DDatagramSocketImpl.java57 protected abstract void bind(int port, InetAddress addr) throws SocketException; in bind()
126 protected abstract void join(InetAddress addr) throws IOException; in join()
154 protected abstract void leave(InetAddress addr) throws IOException; in leave()
181 protected abstract int peek(InetAddress sender) throws IOException; in peek()
245 protected void connect(InetAddress inetAddr, int port) in connect()
276 protected void onBind(InetAddress localAddress, int localPort) { in onBind()
285 protected void onConnect(InetAddress remoteAddress, int remotePort) { in onConnect()
DMulticastSocket.java35 private InetAddress setAddress;
77 public InetAddress getInterface() throws SocketException { in getInterface()
82 InetAddress ipvXaddress = (InetAddress) impl.getOption(SocketOptions.IP_MULTICAST_IF); in getInterface()
88 Enumeration<InetAddress> addresses = theInterface.getInetAddresses(); in getInterface()
91 InetAddress nextAddress = addresses.nextElement(); in getInterface()
147 public void joinGroup(InetAddress groupAddr) throws IOException { in joinGroup()
182 public void leaveGroup(InetAddress groupAddr) throws IOException { in leaveGroup()
220 InetAddress groupAddr = ((InetSocketAddress) groupAddress).getAddress(); in checkJoinOrLeave()
230 private void checkJoinOrLeave(InetAddress groupAddr) throws IOException { in checkJoinOrLeave()
250 InetAddress packAddr = packet.getAddress(); in send()
[all …]
DPlainDatagramSocketImpl.java43 private InetAddress connectedAddress;
59 @Override public void bind(int port, InetAddress address) throws SocketException { in bind()
73 protected void onBind(InetAddress localAddress, int localPort) { in onBind()
121 …private static StructGroupReq makeGroupReq(InetAddress gr_group, NetworkInterface networkInterface… in makeGroupReq()
127 public void join(InetAddress addr) throws IOException { in join()
134 InetAddress groupAddr = ((InetSocketAddress) addr).getAddress(); in joinGroup()
140 public void leave(InetAddress addr) throws IOException { in leave()
147 InetAddress groupAddr = ((InetSocketAddress) addr).getAddress(); in leaveGroup()
153 protected int peek(InetAddress sender) throws IOException { in peek()
183 InetAddress address = isNativeConnected ? null : packet.getAddress(); in send()
[all …]
DSocketImpl.java39 protected InetAddress address;
87 protected abstract void bind(InetAddress address, int port) throws IOException; in bind()
120 protected abstract void connect(InetAddress address, int port) in connect()
156 protected InetAddress getInetAddress() { in getInetAddress()
302 public void onBind(InetAddress localAddress, int localPort) { in onBind()
311 public void onConnect(InetAddress remoteAddress, int remotePort) { in onConnect()
/libcore/luni/src/main/java/android/system/
DStructGroupSourceReq.java19 import java.net.InetAddress;
29 public final InetAddress gsr_group;
30 public final InetAddress gsr_source;
32 public StructGroupSourceReq(int gsr_interface, InetAddress gsr_group, InetAddress gsr_source) { in StructGroupSourceReq()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/
DSSLSocketTest.java22 import java.net.InetAddress;
66 SSLSocket ssl = getSSLSocket(InetAddress.getLocalHost(), sport); in testConstructor_InetAddressI()
72 getSSLSocket(InetAddress.getLocalHost(), sport + 1); in testConstructor_InetAddressI()
79 getSSLSocket(InetAddress.getLocalHost(), invalidPort[i]); in testConstructor_InetAddressI()
93 SSLSocket ssl = getSSLSocket(InetAddress.getLocalHost(), sport, in testConstructor_InetAddressIInetAddressI()
94 InetAddress.getLocalHost(), 0); in testConstructor_InetAddressIInetAddressI()
100 getSSLSocket(InetAddress.getLocalHost(), 8081, InetAddress.getLocalHost(), 8082); in testConstructor_InetAddressIInetAddressI()
106 getSSLSocket(InetAddress.getLocalHost(), -1, InetAddress.getLocalHost(), sport + 1); in testConstructor_InetAddressIInetAddressI()
111 getSSLSocket(InetAddress.getLocalHost(), sport, InetAddress.getLocalHost(), -1); in testConstructor_InetAddressIInetAddressI()
117 getSSLSocket(InetAddress.getLocalHost(), Integer.MIN_VALUE, in testConstructor_InetAddressIInetAddressI()
[all …]
/libcore/luni/src/main/java/javax/net/
DSocketFactory.java21 import java.net.InetAddress;
110 public abstract Socket createSocket(String host, int port, InetAddress localHost, int localPort) in createSocket()
127 public abstract Socket createSocket(InetAddress host, int port) throws IOException; in createSocket()
150 public abstract Socket createSocket(InetAddress address, int port, InetAddress localAddress, in createSocket()
DDefaultSocketFactory.java21 import java.net.InetAddress;
44 public Socket createSocket(String host, int port, InetAddress localHost, int localPort) in createSocket()
50 public Socket createSocket(InetAddress host, int port) throws IOException { in createSocket()
55 public Socket createSocket(InetAddress address, int port, InetAddress localAddress, in createSocket()
/libcore/luni/src/test/java/libcore/java/nio/channels/
DDatagramChannelTest.java23 import java.net.InetAddress;
106 test_bind_any(InetAddress.getByName("0.0.0.0")); in test_bind_any_IPv4()
110 test_bind_any(InetAddress.getByName("::")); in test_bind_any_IPv6()
113 private void test_bind_any(InetAddress bindAddress) throws Exception { in test_bind_any()
128 test_bind(InetAddress.getByName("127.0.0.1")); in test_bind_loopback_IPv4()
132 test_bind(InetAddress.getByName("::1")); in test_bind_loopback_IPv6()
136 InetAddress bindAddress = getNonLoopbackNetworkInterfaceAddress(true /* ipv4 */); in test_bind_IPv4()
141 InetAddress bindAddress = getNonLoopbackNetworkInterfaceAddress(false /* ipv4 */); in test_bind_IPv6()
145 private void test_bind(InetAddress bindAddress) throws IOException { in test_bind()
156 …private static InetAddress getNonLoopbackNetworkInterfaceAddress(boolean ipv4) throws IOException { in getNonLoopbackNetworkInterfaceAddress()
[all …]
/libcore/luni/src/main/java/javax/net/ssl/
DDefaultSSLSocketFactory.java21 import java.net.InetAddress;
61 public Socket createSocket(String host, int port, InetAddress localHost, int localPort) in createSocket()
67 public Socket createSocket(InetAddress host, int port) throws IOException { in createSocket()
72 public Socket createSocket(InetAddress address, int port, InetAddress localAddress, in createSocket()
/libcore/support/src/test/java/org/apache/harmony/xnet/tests/support/
DSSLSocketFactoryImpl.java5 import java.net.InetAddress;
59 public Socket createSocket(InetAddress arg0, int arg1) throws IOException { in createSocket()
68 …public Socket createSocket(String arg0, int arg1, InetAddress arg2, int arg3) throws IOException, … in createSocket()
77 …public Socket createSocket(InetAddress arg0, int arg1, InetAddress arg2, int arg3) throws IOExcept… in createSocket()

1234