Home
last modified time | relevance | path

Searched refs:packet (Results 1 – 6 of 6) sorted by relevance

/libcore/luni/src/test/java/libcore/java/net/
DOldAndroidDatagramTest.java48 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 …]
DOldDatagramPacketTest.java35 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/
DInet6AddressImpl.java258 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/luni/src/test/java/libcore/android/system/
DOsTest.java396 byte[] packet = new byte[42]; in expectSendtoException()
398 Os.sendto(socket, packet, 0, packet.length, 0, addr); in expectSendtoException()
431 byte[] packet = new byte[42]; in expectBindConnectSendtoSuccess()
432 Os.sendto(socket, packet, 0, packet.length, 0, addr); in expectBindConnectSendtoSuccess()
448 Os.sendto(socket, packet, 0, packet.length, 0, addr); in expectBindConnectSendtoSuccess()
449 Os.sendto(socket, packet, 0, packet.length, 0, null); in expectBindConnectSendtoSuccess()
486 byte[] packet = new byte[42]; in expectBindConnectSendtoErrno()
489 Os.sendto(socket, packet, 0, packet.length, 0, addr); in expectBindConnectSendtoErrno()
628 byte[] packet = new byte[64]; in test_PacketSocketAddress()
629 s.send(new DatagramPacket(packet, 0, packet.length, Inet4Address.LOOPBACK, in test_PacketSocketAddress()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/
DDatagramPacketTest.java138 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/
DIoBridge.java590 …, byte[] bytes, int byteOffset, int byteCount, int flags, DatagramPacket packet, boolean isConnect… in recvfrom() argument
593 InetSocketAddress srcAddress = packet != null ? new InetSocketAddress() : null; in recvfrom()
595 result = postRecvfrom(isRead, packet, srcAddress, result); in recvfrom()
602 … isRead, FileDescriptor fd, ByteBuffer buffer, int flags, DatagramPacket packet, boolean isConnect… in recvfrom() argument
605 InetSocketAddress srcAddress = packet != null ? new InetSocketAddress() : null; in recvfrom()
607 result = postRecvfrom(isRead, packet, srcAddress, result); in recvfrom()
614 …private static int postRecvfrom(boolean isRead, DatagramPacket packet, InetSocketAddress srcAddres… in postRecvfrom() argument
618 if (packet != null) { in postRecvfrom()
619 packet.setReceivedLength(byteCount); in postRecvfrom()
620 packet.setPort(srcAddress.getPort()); in postRecvfrom()
[all …]