Home
last modified time | relevance | path

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

1234

/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.java27 import java.net.InetSocketAddress;
79 s.bind(new InetSocketAddress("localhost", 0)); in test_getLocalAddress_after_close()
115 InetSocketAddress listenAddr = new InetSocketAddress(host, 0); in checkSocketLocalAndRemoteAddresses()
125 InetSocketAddress addr = new InetSocketAddress(host, ssc.socket().getLocalPort()); in checkSocketLocalAndRemoteAddresses()
136 InetSocketAddress listenAddress = (InetSocketAddress) in.socket().getLocalSocketAddress(); in checkSocketLocalAndRemoteAddresses()
137InetSocketAddress outRemoteAddress = (InetSocketAddress) out.socket().getRemoteSocketAddress(); in checkSocketLocalAndRemoteAddresses()
138InetSocketAddress outLocalAddress = (InetSocketAddress) out.socket().getLocalSocketAddress(); in checkSocketLocalAndRemoteAddresses()
139 InetSocketAddress inLocalAddress = (InetSocketAddress) in.socket().getLocalSocketAddress(); in checkSocketLocalAndRemoteAddresses()
140InetSocketAddress inRemoteAddress = (InetSocketAddress) in.socket().getRemoteSocketAddress(); in checkSocketLocalAndRemoteAddresses()
183 InetSocketAddress inLocalAddressAfterClose = in checkSocketLocalAndRemoteAddresses()
[all …]
DServerSocketTest.java21 import java.net.InetSocketAddress;
74 ss.bind(new InetSocketAddress(Inet4Address.getLocalHost(), 0)); in testStateAfterClose()
75 InetSocketAddress boundAddress = (InetSocketAddress) ss.getLocalSocketAddress(); in testStateAfterClose()
83 InetSocketAddress localAddressAfterClose = (InetSocketAddress) ss.getLocalSocketAddress(); in testStateAfterClose()
DOldProxyTest.java18 import java.net.InetSocketAddress;
25 private SocketAddress address = new InetSocketAddress("127.0.0.1", 1234);
40 SocketAddress address1 = new InetSocketAddress("127.0.0.1", 1234); in test_hashCode()
52 SocketAddress address2 = new InetSocketAddress("127.0.0.1", 1235); in test_hashCode()
/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 …]
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.java27 import java.net.InetSocketAddress;
108 dc.socket().bind(new InetSocketAddress("unresolvedname", 31415)); in test_bind_unresolvedAddress()
129 dc.socket().bind(new InetSocketAddress(bindAddress, 0)); in test_bind_any()
134 InetSocketAddress actualAddress = (InetSocketAddress) dc.socket().getLocalSocketAddress(); in test_bind_any()
161 dc.socket().bind(new InetSocketAddress(bindAddress, 0)); in test_bind()
163InetSocketAddress actualAddress = (InetSocketAddress) dc.socket().getLocalSocketAddress(); in test_bind()
197 InetSocketAddress socketAddress = new InetSocketAddress(Inet4Address.LOOPBACK, 0); in test_bind()
201 ((InetSocketAddress)(channel.getLocalAddress())).getAddress()); in test_bind()
202 assertTrue(((InetSocketAddress)(channel.getLocalAddress())).getPort() > 0); in test_bind()
210 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 …]
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 …]
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()
457 InetSocketAddress localAddress = (InetSocketAddress) dc.getLocalAddress(); in check_joinAnySource_multicastLoopOption()
462 dc.send(sendBuffer, new InetSocketAddress(group, localAddress.getPort())); in check_joinAnySource_multicastLoopOption()
477 dc.send(sendBuffer2, new InetSocketAddress(group, localAddress.getPort())); in check_joinAnySource_multicastLoopOption()
779 sendingChannel.bind(new InetSocketAddress(senderBindAddress, 0)); in check_block_filtersAsExpected()
780 InetSocketAddress sendingAddress = (InetSocketAddress) sendingChannel.getLocalAddress(); in check_block_filtersAsExpected()
785 … new InetSocketAddress(receiverBindAddress, 0) /* local port left to the OS to determine */); in check_block_filtersAsExpected()
786 InetSocketAddress localReceivingAddress = in check_block_filtersAsExpected()
[all …]
DMembershipKeyTest.java25 import java.net.InetSocketAddress;
46 .bind(new InetSocketAddress(Inet4Address.ANY, PORT)); in init()
108 .bind(new InetSocketAddress(Inet4Address.LOOPBACK, 0)) in check_drop()
110 new InetSocketAddress(MULTICAST_ADDRESS, PORT))); in check_drop()
174 .bind(new InetSocketAddress(Inet4Address.LOOPBACK, 0)) in test_blockWithJoinWithoutSource()
176 new InetSocketAddress(MULTICAST_ADDRESS, PORT))); in test_blockWithJoinWithoutSource()
223 .bind(new InetSocketAddress(Inet4Address.LOOPBACK, 0)) in test_unblockWithJoinWithoutSource()
226 new InetSocketAddress(MULTICAST_ADDRESS, PORT))); in test_unblockWithJoinWithoutSource()
/libcore/ojluni/annotations/mmodule/java/net/
DInetSocketAddress.annotated.java31 public class InetSocketAddress extends java.net.SocketAddress { class
35 public InetSocketAddress() { throw new RuntimeException("Stub!"); } in InetSocketAddress() method in InetSocketAddress
37 public InetSocketAddress(int port) { throw new RuntimeException("Stub!"); } in InetSocketAddress() method in InetSocketAddress
39 public InetSocketAddress(java.net.InetAddress addr, int port) { throw new RuntimeException("Stub!")… in InetSocketAddress() method in InetSocketAddress
41 public InetSocketAddress(java.lang.String hostname, int port) { throw new RuntimeException("Stub!")… in InetSocketAddress() method in InetSocketAddress
43 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/
DMulticastSocket.java113 this(new InetSocketAddress(0)); in MulticastSocket()
138 this(new InetSocketAddress(port)); in MulticastSocket()
392 if (mcastaddr == null || !(mcastaddr instanceof InetSocketAddress)) in joinGroup()
398 checkAddress(((InetSocketAddress)mcastaddr).getAddress(), "joinGroup"); in joinGroup()
401 security.checkMulticast(((InetSocketAddress)mcastaddr).getAddress()); in joinGroup()
404 if (!((InetSocketAddress)mcastaddr).getAddress().isMulticastAddress()) { in joinGroup()
439 if (mcastaddr == null || !(mcastaddr instanceof InetSocketAddress)) in leaveGroup()
445 checkAddress(((InetSocketAddress)mcastaddr).getAddress(), "leaveGroup"); in leaveGroup()
448 security.checkMulticast(((InetSocketAddress)mcastaddr).getAddress()); in leaveGroup()
451 if (!((InetSocketAddress)mcastaddr).getAddress().isMulticastAddress()) { in leaveGroup()
DDatagramSocket.java154 bind(new InetSocketAddress(0)); in connectInternal()
216 this(new InetSocketAddress(0)); in DatagramSocket()
319 this(new InetSocketAddress(laddr, port)); in DatagramSocket()
398 addr = new InetSocketAddress(0); in bind()
399 if (!(addr instanceof InetSocketAddress)) in bind()
401 InetSocketAddress epoint = (InetSocketAddress) addr; in bind()
512 if (!(addr instanceof InetSocketAddress)) in connect()
514 InetSocketAddress epoint = (InetSocketAddress) addr; in connect()
615 return new InetSocketAddress(getInetAddress(), getPort()); in getRemoteSocketAddress()
634 return new InetSocketAddress(getLocalAddress(), getLocalPort()); in getLocalSocketAddress()
[all …]
DDatagramPacket.java338 if (address == null || !(address instanceof InetSocketAddress)) in setSocketAddress()
340 InetSocketAddress addr = (InetSocketAddress) address; in setSocketAddress()
356 return new InetSocketAddress(getAddress(), getPort()); in getSocketAddress()
/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 …]
DServerSocketChannelImpl.java75 private InetSocketAddress localAddress; // null => unbound
204 public InetSocketAddress localAddress() { in localAddress()
217 InetSocketAddress isa = (local == null) ? new InetSocketAddress(0) : in bind()
242 InetSocketAddress[] isaa = new InetSocketAddress[1]; in accept()
265 InetSocketAddress isa = isaa[0]; in accept()
401 InetSocketAddress addr = localAddress(); in toString()
419 InetSocketAddress[] isaa) in accept()
433 InetSocketAddress[] isaa) in accept0()
DDatagramSocketAdaptor.java72 InetSocketAddress isa = Net.asInetSocketAddress(remote); in connectInternal()
90 local = new InetSocketAddress(0); in bind()
99 connectInternal(new InetSocketAddress(address, port)); in connect()
152 InetSocketAddress isa = (InetSocketAddress) in send()
231 local = new InetSocketAddress(0); in getLocalAddress()
232 InetAddress result = ((InetSocketAddress)local).getAddress(); in getLocalAddress()
238 return new InetSocketAddress(0).getAddress(); in getLocalAddress()
250 return ((InetSocketAddress)local).getPort(); in getLocalPort()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
DServerSocketChannelTest.java23 import java.net.InetSocketAddress;
121InetSocketAddress localAddress = (InetSocketAddress) ssc.socket().getLocalSocketAddress(); in test_bind_null()
163InetSocketAddress address = (InetSocketAddress) portPickingChannel.socket().getLocalSocketAddress(… in test_bind_explicitPort()
170 InetSocketAddress bindAddress = new InetSocketAddress("localhost", address.getPort()); in test_bind_explicitPort()
173 InetSocketAddress boundAddress = (InetSocketAddress) ssc.socket().getLocalSocketAddress(); in test_bind_explicitPort()
188 InetSocketAddress bindAddr = new InetSocketAddress("localhost", 0); in test_bind_socketSync()
191 InetSocketAddress actualAddr = (InetSocketAddress) ssc.socket().getLocalSocketAddress(); in test_bind_socketSync()
207 InetSocketAddress bindAddr = new InetSocketAddress("localhost", 0); in test_bind_socketSyncAfterBind()
212 InetSocketAddress actualAddr = (InetSocketAddress) ssc.socket().getLocalSocketAddress(); in test_bind_socketSyncAfterBind()
232 InetSocketAddress bindAddr = new InetSocketAddress("localhost", 0); in test_getLocalSocketAddress_afterClose()
[all …]
DDatagramChannelTest.java26 import java.net.InetSocketAddress;
60 private InetSocketAddress datagramSocket1Address;
61 private InetSocketAddress datagramSocket2Address;
63 private InetSocketAddress channel1Address;
64 private InetSocketAddress channel2Address;
78 channel1.socket().bind(new InetSocketAddress(Inet6Address.LOOPBACK, 0)); in setUp()
79 channel2.socket().bind(new InetSocketAddress(Inet6Address.LOOPBACK, 0)); in setUp()
81 channel1Address = (InetSocketAddress) channel1.socket().getLocalSocketAddress(); in setUp()
82 channel2Address = (InetSocketAddress) channel2.socket().getLocalSocketAddress(); in setUp()
87 datagramSocket1Address = (InetSocketAddress) datagramSocket1.getLocalSocketAddress(); in setUp()
[all …]

1234