Home
last modified time | relevance | path

Searched refs:packet (Results 1 – 7 of 7) 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/luni/src/main/java/android/system/
DStructIcmpHdr.java29 private byte[] packet; field in StructIcmpHdr
32 packet = new byte[8]; in StructIcmpHdr()
50 hdr.packet[0] = ipv4 ? (byte) ICMP_ECHO : (byte) ICMP6_ECHO_REQUEST; in IcmpEchoHdr()
54 hdr.packet[6] = (byte) (seq >> 8); in IcmpEchoHdr()
55 hdr.packet[7] = (byte) seq; in IcmpEchoHdr()
60 return packet.clone(); in getBytes()
/libcore/ojluni/src/main/java/java/net/
DInet6AddressImpl.java258 byte[] packet; in icmpEcho()
266 packet = StructIcmpHdr.IcmpEchoHdr(isIPv4, seq).getBytes(); 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/
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.java594 …, byte[] bytes, int byteOffset, int byteCount, int flags, DatagramPacket packet, boolean isConnect… in recvfrom() argument
597 InetSocketAddress srcAddress = packet != null ? new InetSocketAddress() : null; in recvfrom()
599 result = postRecvfrom(isRead, packet, srcAddress, result); in recvfrom()
606 … isRead, FileDescriptor fd, ByteBuffer buffer, int flags, DatagramPacket packet, boolean isConnect… in recvfrom() argument
609 InetSocketAddress srcAddress = packet != null ? new InetSocketAddress() : null; in recvfrom()
611 result = postRecvfrom(isRead, packet, srcAddress, result); in recvfrom()
618 …private static int postRecvfrom(boolean isRead, DatagramPacket packet, InetSocketAddress srcAddres… in postRecvfrom() argument
622 if (packet != null) { in postRecvfrom()
623 packet.setReceivedLength(byteCount); in postRecvfrom()
624 packet.setPort(srcAddress.getPort()); in postRecvfrom()
[all …]
/libcore/luni/src/test/java/libcore/android/system/
DOsTest.java356 byte[] packet = new byte[42]; in expectSendtoException()
358 Os.sendto(socket, packet, 0, packet.length, 0, addr); in expectSendtoException()
391 byte[] packet = new byte[42]; in expectBindConnectSendtoSuccess()
392 Os.sendto(socket, packet, 0, packet.length, 0, addr); in expectBindConnectSendtoSuccess()
408 Os.sendto(socket, packet, 0, packet.length, 0, addr); in expectBindConnectSendtoSuccess()
409 Os.sendto(socket, packet, 0, packet.length, 0, null); in expectBindConnectSendtoSuccess()
446 byte[] packet = new byte[42]; in expectBindConnectSendtoErrno()
449 Os.sendto(socket, packet, 0, packet.length, 0, addr); in expectBindConnectSendtoErrno()
636 private static void checkSocketPing(FileDescriptor fd, InetAddress to, byte[] packet, in checkSocketPing() argument
638 int len = packet.length; in checkSocketPing()
[all …]