/libcore/luni/src/test/java/libcore/java/net/ |
D | OldAndroidDatagramTest.java | 48 DatagramPacket packet; field in OldAndroidDatagramTest.Reflector 58 packet.setLength(buffer.length); in run() 59 socket.receive(packet); in run() 60 String s = stringFromPacket(packet); in run() 69 stringToPacket(s.toUpperCase(), packet); in run() local 71 packet.setAddress(InetAddress.getLocalHost()); in run() 72 packet.setPort(2345); in run() 74 socket.send(packet); in run() 90 packet = new DatagramPacket(buffer, buffer.length); in Reflector() 102 static String stringFromPacket(DatagramPacket packet) { in stringFromPacket() argument [all …]
|
D | OldDatagramPacketTest.java | 35 DatagramPacket packet = new DatagramPacket(new byte[256], 256); in test_getPort() 37 ss.receive(packet); in test_getPort() 38 ss.send(packet); in test_getPort() 49 …DatagramPacket packet = new DatagramPacket(bytes, 6, InetAddress.getByName("localhost"), ss.getLoc… in test_getPort() local 50 cs.send(packet); in test_getPort() 52 cs.receive(packet); in test_getPort() 54 assertEquals(packet.getPort(), ss.getLocalPort()); in test_getPort()
|
/libcore/ojluni/src/main/java/java/net/ |
D | Inet6AddressImpl.java | 258 byte[] packet; in icmpEcho() 266 packet = IcmpHeaders.createIcmpEchoHdr(isIPv4, seq); in icmpEcho() 267 IoBridge.sendto(fd, packet, 0, packet.length, 0, addr, 0); in icmpEcho() 270 byte[] received = new byte[packet.length]; in icmpEcho() 271 DatagramPacket receivedPacket = new DatagramPacket(received, packet.length); in icmpEcho() 274 if (size == packet.length) { in icmpEcho()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/ |
D | DatagramPacketTest.java | 138 DatagramPacket packet = new DatagramPacket(new byte[] { 1, 2, 3, 4, 5, in test_getPort() local 140 socket.send(packet); in test_getPort() 141 socket.receive(packet); in test_getPort() 143 assertTrue("datagram received wrong port: " + packet.getPort(), packet in test_getPort()
|
/libcore/luni/src/main/java/libcore/io/ |
D | IoBridge.java | 752 …ytes, int byteOffset, int byteCount, int flags, @Nullable DatagramPacket packet, boolean isConnect… in recvfrom() argument 755 InetSocketAddress srcAddress = packet != null ? new InetSocketAddress() : null; in recvfrom() 757 result = postRecvfrom(isRead, packet, srcAddress, result); in recvfrom() 765 … isRead, FileDescriptor fd, ByteBuffer buffer, int flags, DatagramPacket packet, boolean isConnect… in recvfrom() argument 768 InetSocketAddress srcAddress = packet != null ? new InetSocketAddress() : null; in recvfrom() 770 result = postRecvfrom(isRead, packet, srcAddress, result); in recvfrom() 777 …private static int postRecvfrom(boolean isRead, DatagramPacket packet, InetSocketAddress srcAddres… in postRecvfrom() argument 781 if (packet != null) { in postRecvfrom() 782 packet.setReceivedLength(byteCount); in postRecvfrom() 783 packet.setPort(srcAddress.getPort()); in postRecvfrom() [all …]
|
/libcore/luni/src/test/java/libcore/android/system/ |
D | OsTest.java | 422 byte[] packet = new byte[42]; in expectSendtoException() 424 Os.sendto(socket, packet, 0, packet.length, 0, addr); in expectSendtoException() 457 byte[] packet = new byte[42]; in expectBindConnectSendtoSuccess() 458 Os.sendto(socket, packet, 0, packet.length, 0, addr); in expectBindConnectSendtoSuccess() 475 Os.sendto(socket, packet, 0, packet.length, 0, addr); in expectBindConnectSendtoSuccess() 476 Os.sendto(socket, packet, 0, packet.length, 0, null); in expectBindConnectSendtoSuccess() 513 byte[] packet = new byte[42]; in expectBindConnectSendtoErrno() 516 Os.sendto(socket, packet, 0, packet.length, 0, addr); in expectBindConnectSendtoErrno() 661 byte[] packet = new byte[64]; in test_PacketSocketAddress() 662 s.send(new DatagramPacket(packet, 0, packet.length, Inet4Address.LOOPBACK, in test_PacketSocketAddress() [all …]
|