Home
last modified time | relevance | path

Searched refs:InetSocketAddress (Results 1 – 25 of 102) sorted by relevance

12345

/libcore/luni/src/test/java/libcore/java/net/
DInetSocketAddressTest.java20 import java.net.InetSocketAddress;
26 new InetSocketAddress("127.0.0.1", -1); in test_ConstructorLjava_lang_StringI()
31 new InetSocketAddress("127.0.0.1", 65536); in test_ConstructorLjava_lang_StringI()
60 InetSocketAddress isa = new InetSocketAddress(ia, 80); 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()
82 InetSocketAddress isa = new InetSocketAddress(65535); in test_ConstructorI()
87 new InetSocketAddress(-1); in test_ConstructorI()
93 new InetSocketAddress(65536); in test_ConstructorI()
[all …]
DSocketTest.java44 import java.net.InetSocketAddress;
113 s.bind(new InetSocketAddress("localhost", 0)); in test_getLocalAddress_after_close()
151 InetSocketAddress listenAddr = new InetSocketAddress(host, 0); in checkSocketLocalAndRemoteAddresses()
161 InetSocketAddress addr = new InetSocketAddress(host, ssc.socket().getLocalPort()); in checkSocketLocalAndRemoteAddresses()
172 InetSocketAddress listenAddress = (InetSocketAddress) in.socket().getLocalSocketAddress(); in checkSocketLocalAndRemoteAddresses()
173InetSocketAddress outRemoteAddress = (InetSocketAddress) out.socket().getRemoteSocketAddress(); in checkSocketLocalAndRemoteAddresses()
174InetSocketAddress outLocalAddress = (InetSocketAddress) out.socket().getLocalSocketAddress(); in checkSocketLocalAndRemoteAddresses()
175 InetSocketAddress inLocalAddress = (InetSocketAddress) in.socket().getLocalSocketAddress(); in checkSocketLocalAndRemoteAddresses()
176InetSocketAddress inRemoteAddress = (InetSocketAddress) in.socket().getRemoteSocketAddress(); in checkSocketLocalAndRemoteAddresses()
219 InetSocketAddress inLocalAddressAfterClose = in checkSocketLocalAndRemoteAddresses()
[all …]
DServerSocketTest.java21 import java.net.InetSocketAddress;
76 ss.bind(new InetSocketAddress(Inet4Address.getLocalHost(), 0)); in testStateAfterClose()
77 InetSocketAddress boundAddress = (InetSocketAddress) ss.getLocalSocketAddress(); in testStateAfterClose()
85 InetSocketAddress localAddressAfterClose = (InetSocketAddress) ss.getLocalSocketAddress(); in testStateAfterClose()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/
DInetSocketAddressTest.java19 import java.net.InetSocketAddress;
33 InetSocketAddress address = new InetSocketAddress("127.0.0.1", 0); in test_ConstructorLjava_lang_StringI()
49 InetSocketAddress isa = InetSocketAddress.createUnresolved( in test_createUnresolvedLjava_lang_StringI()
66 InetSocketAddress.createUnresolved( in test_createUnresolvedLjava_lang_StringI_IllegalArgumentException()
99 InetSocketAddress init = (InetSocketAddress) initial;
100 InetSocketAddress desr = (InetSocketAddress) deserialized;
114 InetSocketAddress.createUnresolved("badhost", 1000), // unresolved in testSerializationSelf()
115 new InetSocketAddress("Localhost", 1000) }; in testSerializationSelf()
126 InetSocketAddress.createUnresolved("badhost", 1000), // unresolved in testSerializationCompatibility()
127 new InetSocketAddress("Localhost", 1000) }; in testSerializationCompatibility()
DSocketTest.java25 import java.net.InetSocketAddress;
51 InetSocketAddress addr = new InetSocketAddress(host, port); in run()
79 new InetSocketAddress(host, port).getAddress()); in run()
164 InetSocketAddress bogusAddress = new InetSocketAddress(InetAddress in test_bindLjava_net_SocketAddress()
176 theSocket.bind(new InetSocketAddress(InetAddress.getLocalHost(), 0)); in test_bindLjava_net_SocketAddress()
182 new InetSocketAddress(InetAddress.getLocalHost(), portNumber), in test_bindLjava_net_SocketAddress()
187 InetSocketAddress theAddress = new InetSocketAddress(InetAddress in test_bindLjava_net_SocketAddress()
192 InetSocketAddress boundAddress = new InetSocketAddress(InetAddress in test_bindLjava_net_SocketAddress()
199 new InetSocketAddress(InetAddress.getLocalHost(), portNumber), in test_bindLjava_net_SocketAddress()
217 theAddress = new InetSocketAddress(InetAddress.getLocalHost(), 0); in test_bindLjava_net_SocketAddress()
[all …]
DDatagramPacketTest.java24 import java.net.InetSocketAddress;
227 InetSocketAddress theAddress = new InetSocketAddress(InetAddress in test_Constructor$BILjava_net_SocketAddress()
233 new InetSocketAddress(thePacket.getAddress(), thePacket in test_Constructor$BILjava_net_SocketAddress()
268 InetSocketAddress theAddress = new InetSocketAddress(InetAddress in test_Constructor$BIILjava_net_SocketAddress()
274 new InetSocketAddress(thePacket.getAddress(), thePacket in test_Constructor$BIILjava_net_SocketAddress()
287 InetSocketAddress theAddress = new InetSocketAddress(InetAddress in test_getSocketAddress()
328 InetSocketAddress theAddress = new InetSocketAddress(InetAddress in test_setSocketAddressLjava_net_SocketAddress()
335 new InetSocketAddress(thePacket.getAddress(), thePacket in test_setSocketAddressLjava_net_SocketAddress()
DMulticastSocketTest.java33 import java.net.InetSocketAddress;
248 InetSocketAddress groupAddress = in test_joinGroupLjava_net_InetAddress()
249 new InetSocketAddress(group, receivingSocket.getLocalPort()); in test_joinGroupLjava_net_InetAddress()
279 mss.joinGroup(new InetSocketAddress(InetAddress.getByName("127.0.0.1"), 0), null); in joinGroup_non_multicast_address_IPv4()
291 mss.joinGroup(new InetSocketAddress(InetAddress.getByName("::1"), 0), null); in joinGroup_non_multicast_address_IPv6()
338 InetSocketAddress groupAddress = in check_joinGroupLjava_net_SocketAddressLjava_net_NetworkInterface()
339 new InetSocketAddress(group, receivingSocket.getLocalPort()); in check_joinGroupLjava_net_SocketAddressLjava_net_NetworkInterface()
363 groupAddress = new InetSocketAddress(group, receivingSocket.getLocalPort()); in check_joinGroupLjava_net_SocketAddressLjava_net_NetworkInterface()
368 InetSocketAddress group2Address = in check_joinGroupLjava_net_SocketAddressLjava_net_NetworkInterface()
369 new InetSocketAddress(group2, receivingSocket.getLocalPort()); in check_joinGroupLjava_net_SocketAddressLjava_net_NetworkInterface()
[all …]
DDatagramSocketTest.java28 import java.net.InetSocketAddress;
528 InetSocketAddress addr = InetSocketAddress.createUnresolved( in testArchivedHarmonyRegressions()
617 new InetSocketAddress(InetAddress.getLocalHost(), 0))) { in test_ConstructorLjava_net_SocketAddress()
677 theSocket = new DatagramSocket(new InetSocketAddress(Inet6Address.LOOPBACK, 0)); in test_isBound()
687 theSocket.connect(new InetSocketAddress(Inet6Address.LOOPBACK, 0)); in test_isBound()
692 InetSocketAddress theLocalAddress = new InetSocketAddress(Inet6Address.LOOPBACK, 0); in test_isBound()
707 theSocket.connect(new InetSocketAddress(Inet6Address.LOOPBACK, ds.getPort())); in test_isConnected()
711 theSocket.connect(new InetSocketAddress(Inet6Address.LOOPBACK, ds.getPort())); in test_isConnected()
721 theSocket.connect(new InetSocketAddress(Inet6Address.LOOPBACK, ds.getPort())); in test_isConnected()
730 s.connect(new InetSocketAddress(Inet6Address.LOOPBACK, server.getPort())); in test_getRemoteSocketAddress()
[all …]
DServerSocketTest.java34 import java.net.InetSocketAddress;
413 InetSocketAddress theAddress = new InetSocketAddress(InetAddress in test_bindLjava_net_SocketAddress()
421 + (new InetSocketAddress(InetAddress.getLocalHost(), in test_bindLjava_net_SocketAddress()
424 new InetSocketAddress(InetAddress in test_bindLjava_net_SocketAddress()
432 InetSocketAddress clAddress = new InetSocketAddress(InetAddress in test_bindLjava_net_SocketAddress()
452 theAddress = new InetSocketAddress(InetAddress.getLocalHost(), 0); in test_bindLjava_net_SocketAddress()
466 theSocket.bind(new InetSocketAddress(InetAddress in test_bindLjava_net_SocketAddress()
497 InetSocketAddress theAddress = new InetSocketAddress(InetAddress in test_bindLjava_net_SocketAddressI()
505 + (new InetSocketAddress(InetAddress.getLocalHost(), in test_bindLjava_net_SocketAddressI()
508 new InetSocketAddress(InetAddress in test_bindLjava_net_SocketAddressI()
[all …]
/libcore/luni/src/test/java/libcore/java/nio/channels/
DServerSocketChannelTest.java29 import java.net.InetSocketAddress;
84 ssc.socket().bind(new InetSocketAddress("unresolvedname", 31415)); in bind_unresolvedAddress()
99 InetSocketAddress boundAddress = (InetSocketAddress) ssc.socket().getLocalSocketAddress(); in bind_nullBindsToAll()
113 InetSocketAddress address = in bind_nullBindsToAll()
114 new InetSocketAddress(inetAddresses.nextElement(), boundAddress.getPort()); in bind_nullBindsToAll()
170 ssc.socket().bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 5); in bind_loopback()
171 InetSocketAddress boundAddress = (InetSocketAddress) ssc.socket().getLocalSocketAddress(); in bind_loopback()
179 InetSocketAddress loopbackAddress = in bind_loopback()
180 new InetSocketAddress(InetAddress.getLoopbackAddress(), boundAddress.getPort()); in bind_loopback()
197 InetSocketAddress address = in bind_loopback()
[all …]
DDatagramChannelTest.java34 import java.net.InetSocketAddress;
117 dc.socket().bind(new InetSocketAddress("unresolvedname", 31415)); in test_bind_unresolvedAddress()
140 dc.socket().bind(new InetSocketAddress(bindAddress, 0)); in test_bind_any()
145 InetSocketAddress actualAddress = (InetSocketAddress) dc.socket() in test_bind_any()
178 dc.socket().bind(new InetSocketAddress(bindAddress, 0)); in test_bind()
180InetSocketAddress actualAddress = (InetSocketAddress) dc.socket().getLocalSocketAddress(); in test_bind()
217 InetSocketAddress socketAddress = new InetSocketAddress(Inet4Address.LOOPBACK, 0); in test_bind()
221 ((InetSocketAddress)(channel.getLocalAddress())).getAddress()); in test_bind()
222 assertTrue(((InetSocketAddress)(channel.getLocalAddress())).getPort() > 0); in test_bind()
230 socketAddress = new InetSocketAddress(Inet4Address.LOOPBACK, in test_bind()
[all …]
DSocketChannelTest.java29 import java.net.InetSocketAddress;
87 sc.connect(new InetSocketAddress(InetAddress.getByAddress(new byte[] { in test_56684()
169 sc.socket().bind(new InetSocketAddress("unresolvedname", 31415)); in test_bind_unresolvedAddress()
190 InetSocketAddress bindAddr = new InetSocketAddress("localhost", 0); in test_bind_socketStateSync()
193 InetSocketAddress actualAddr = (InetSocketAddress) sc.socket().getLocalSocketAddress(); in test_bind_socketStateSync()
214 InetSocketAddress bindAddr = new InetSocketAddress("localhost", 0); in test_bind_socketObjectCreationAfterBind()
219 InetSocketAddress actualAddr = (InetSocketAddress) sc.socket().getLocalSocketAddress(); in test_bind_socketObjectCreationAfterBind()
309 InetSocketAddress socketAddress = new InetSocketAddress(Inet4Address.LOOPBACK, 0); in test_bind()
313 ((InetSocketAddress) (sc.getLocalAddress())).getAddress()); in test_bind()
314 assertTrue(((InetSocketAddress) (sc.getLocalAddress())).getPort() > 0); in test_bind()
[all …]
DDatagramChannelMulticastTest.java25 import java.net.InetSocketAddress;
238 InetSocketAddress localAddress = (InetSocketAddress) receiverChannel.getLocalAddress(); in check_joinAnySource()
360 InetSocketAddress localAddress = (InetSocketAddress) dc.getLocalAddress(); in test_joinAnySource_networkInterfaces()
456 InetSocketAddress localAddress = (InetSocketAddress) dc.getLocalAddress(); in check_joinAnySource_multicastLoopOption()
461 dc.send(sendBuffer, new InetSocketAddress(group, localAddress.getPort())); in check_joinAnySource_multicastLoopOption()
476 dc.send(sendBuffer2, new InetSocketAddress(group, localAddress.getPort())); in check_joinAnySource_multicastLoopOption()
778 sendingChannel.bind(new InetSocketAddress(senderBindAddress, 0)); in check_block_filtersAsExpected()
779 InetSocketAddress sendingAddress = (InetSocketAddress) sendingChannel.getLocalAddress(); in check_block_filtersAsExpected()
784 … new InetSocketAddress(receiverBindAddress, 0) /* local port left to the OS to determine */); in check_block_filtersAsExpected()
785 InetSocketAddress localReceivingAddress = in check_block_filtersAsExpected()
[all …]
DAsynchronousServerSocketChannelTest.java23 import java.net.InetSocketAddress;
56 assc.bind(new InetSocketAddress(0)); in test_bind()
59 assc.bind(new InetSocketAddress(0)); in test_bind()
85 assc.bind(new InetSocketAddress("unresolvedname", 31415)); in test_bind_unresolvedAddress()
109 assc.bind(new InetSocketAddress(0)); in test_futureAccept()
131 assc.bind(new InetSocketAddress(0)); in test_completionHandlerAccept()
158 assc.bind(new InetSocketAddress(0)); in test_completionHandlerAccept_attachment()
195 assc.bind(new InetSocketAddress(0)); in test_completionHandlerAccept_npe()
237 assc.bind(new InetSocketAddress(0)); in test_group()
245 assc.bind(new InetSocketAddress(0)); in test_close()
[all …]
/libcore/ojluni/src/test/java/net/InetSocketAddress/
DB4849451.java23 package test.java.net.InetSocketAddress;
39 InetSocketAddress addr1 = InetSocketAddress.createUnresolved("unresolveable", 10); in testMatches()
40 InetSocketAddress addr2 = InetSocketAddress.createUnresolved("UNRESOLVEABLE", 10); in testMatches()
DCreateUnresolved.java23 package test.java.net.InetSocketAddress;
30 import java.net.InetSocketAddress;
38 InetSocketAddress a = InetSocketAddress.createUnresolved("unresolved", 1234); in testUnresolved()
DB6469803.java23 package test.java.net.InetSocketAddress;
39 InetSocketAddress addr = new InetSocketAddress("192.168.1.1", 12345); in testLocalHost()
42 addr = new InetSocketAddress("localhost", 12345); in testLocalHost()
DToString.java23 package test.java.net.InetSocketAddress;
56 InetSocketAddress isa = new InetSocketAddress((InetAddress) null, 80);
78 new InetSocketAddress("unresolved", 12345); in NPETest()
99 String received = InetSocketAddress.createUnresolved(host, port).toString(); in testCreateUnresolved()
/libcore/ojluni/annotations/mmodule/java/net/
DInetSocketAddress.annotated.java31 public class InetSocketAddress extends java.net.SocketAddress { class
34 public InetSocketAddress() { throw new RuntimeException("Stub!"); } in InetSocketAddress() method in InetSocketAddress
36 public InetSocketAddress(int port) { throw new RuntimeException("Stub!"); } in InetSocketAddress() method in InetSocketAddress
38 public InetSocketAddress(java.net.InetAddress addr, int port) { throw new RuntimeException("Stub!")… in InetSocketAddress() method in InetSocketAddress
40 public InetSocketAddress(java.lang.String hostname, int port) { throw new RuntimeException("Stub!")… in InetSocketAddress() method in InetSocketAddress
42 public static java.net.InetSocketAddress createUnresolved(java.lang.String host, int port) { throw … in createUnresolved()
/libcore/ojluni/annotations/hiddenapi/java/net/
DInetSocketAddress.java32 public class InetSocketAddress extends java.net.SocketAddress { class
34 public InetSocketAddress() { in InetSocketAddress() method in InetSocketAddress
38 public InetSocketAddress(int port) { in InetSocketAddress() method in InetSocketAddress
42 public InetSocketAddress(java.net.InetAddress addr, int port) { in InetSocketAddress() method in InetSocketAddress
46 public InetSocketAddress(java.lang.String hostname, int port) { in InetSocketAddress() method in InetSocketAddress
50 private InetSocketAddress(int port, java.lang.String hostname) { in InetSocketAddress() method in InetSocketAddress
62 public static java.net.InetSocketAddress createUnresolved(java.lang.String host, int port) { in createUnresolved()
124 private final transient java.net.InetSocketAddress.InetSocketAddressHolder holder;
/libcore/ojluni/src/main/java/java/net/
DInetSocketAddress.java53 public class InetSocketAddress class
168 public InetSocketAddress() { in InetSocketAddress() method in InetSocketAddress
186 public InetSocketAddress(int port) { in InetSocketAddress() method in InetSocketAddress
207 public InetSocketAddress(InetAddress addr, int port) { in InetSocketAddress() method in InetSocketAddress
240 public InetSocketAddress(String hostname, int port) { in InetSocketAddress() method in InetSocketAddress
253 private InetSocketAddress(int port, String hostname) { in InetSocketAddress() method in InetSocketAddress
278 public static InetSocketAddress createUnresolved(String host, int port) { in createUnresolved()
279 return new InetSocketAddress(checkPort(port), checkHost(host)); in createUnresolved()
354 = UNSAFE.objectFieldOffset(InetSocketAddress.class, "holder");
451 if (obj == null || !(obj instanceof InetSocketAddress)) in equals()
[all …]
DMulticastSocket.java116 this(new InetSocketAddress(0)); in MulticastSocket()
141 this(new InetSocketAddress(port)); in MulticastSocket()
398 if (mcastaddr == null || !(mcastaddr instanceof InetSocketAddress)) in joinGroup()
404 checkAddress(((InetSocketAddress)mcastaddr).getAddress(), "joinGroup"); in joinGroup()
407 security.checkMulticast(((InetSocketAddress)mcastaddr).getAddress()); in joinGroup()
410 if (!((InetSocketAddress)mcastaddr).getAddress().isMulticastAddress()) { in joinGroup()
445 if (mcastaddr == null || !(mcastaddr instanceof InetSocketAddress)) in leaveGroup()
451 checkAddress(((InetSocketAddress)mcastaddr).getAddress(), "leaveGroup"); in leaveGroup()
454 security.checkMulticast(((InetSocketAddress)mcastaddr).getAddress()); in leaveGroup()
457 if (!((InetSocketAddress)mcastaddr).getAddress().isMulticastAddress()) { in leaveGroup()
DSocket.java134 InetSocketAddress epoint = (InetSocketAddress) p.address(); in Socket()
140 epoint = new InetSocketAddress(epoint.getHostName(), epoint.getPort()); in Socket()
318 new InetSocketAddress(localAddr, localPort), true); in Socket()
360 new InetSocketAddress(localAddr, localPort), true); in Socket()
449 this(nonNullAddress(host), port, new InetSocketAddress(0), stream); in Socket()
470 InetSocketAddress address = new InetSocketAddress(addresses[i], port); in Socket()
628 if (!(endpoint instanceof InetSocketAddress)) in connect()
631 InetSocketAddress epoint = (InetSocketAddress) endpoint; in connect()
686 if (bindpoint != null && (!(bindpoint instanceof InetSocketAddress))) in bind()
688 InetSocketAddress epoint = (InetSocketAddress) bindpoint; in bind()
[all …]
/libcore/ojluni/src/main/java/sun/nio/ch/
DNet.java96 public static InetSocketAddress checkAddress(SocketAddress sa) { in checkAddress()
103 if (!(sa instanceof InetSocketAddress)) in checkAddress()
105 InetSocketAddress isa = (InetSocketAddress)sa; in checkAddress()
114 static InetSocketAddress asInetSocketAddress(SocketAddress sa) { in asInetSocketAddress()
115 if (!(sa instanceof InetSocketAddress)) in asInetSocketAddress()
117 return (InetSocketAddress)sa; in asInetSocketAddress()
178 static InetSocketAddress getRevealedLocalAddress(InetSocketAddress addr) { in getRevealedLocalAddress()
193 static String getRevealedLocalAddressAsString(InetSocketAddress addr) { in getRevealedLocalAddressAsString()
198 private static InetSocketAddress getLoopbackAddress(int port) { in getLoopbackAddress()
199 return new InetSocketAddress(InetAddress.getLoopbackAddress(), in getLoopbackAddress()
[all …]
/libcore/ojluni/src/test/java/net/DatagramSocket/
DReuseAddressTest.java27 import java.net.InetSocketAddress;
59 static InetSocketAddress createSocketAddress(int testMcastPort) throws Exception { in createSocketAddress()
61 InetSocketAddress localSocketAddress = new InetSocketAddress(localAddress, testMcastPort); in createSocketAddress()
116 InetSocketAddress addr = createSocketAddress(0); in DatagramSocket0030()
169 InetSocketAddress addr = createSocketAddress(0); in DatagramSocket0031()
216 InetSocketAddress isa1 = createSocketAddress(0); in DatagramSocket0032()
225 InetSocketAddress isa2 = new InetSocketAddress(wildcard, ds1.getLocalPort()); in DatagramSocket0032()

12345