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/native/
DPlainDatagramSocketImpl.c365 jobject packet) { in PlainDatagramSocketImpl_send() argument
392 if (IS_NULL(packet)) { in PlainDatagramSocketImpl_send()
399 packetBuffer = (*env)->GetObjectField(env, packet, dp_bufID); in PlainDatagramSocketImpl_send()
400 packetAddress = (*env)->GetObjectField(env, packet, dp_addressID); in PlainDatagramSocketImpl_send()
406 packetBufferOffset = (*env)->GetIntField(env, packet, dp_offsetID); in PlainDatagramSocketImpl_send()
407 packetBufferLen = (*env)->GetIntField(env, packet, dp_lengthID); in PlainDatagramSocketImpl_send()
414 packetPort = (*env)->GetIntField(env, packet, dp_portID); in PlainDatagramSocketImpl_send()
586 jobject packet) { in PlainDatagramSocketImpl_peekData() argument
612 if (IS_NULL(packet)) { in PlainDatagramSocketImpl_peekData()
617 packetBuffer = (*env)->GetObjectField(env, packet, dp_bufID); in PlainDatagramSocketImpl_peekData()
[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.java548 …, byte[] bytes, int byteOffset, int byteCount, int flags, DatagramPacket packet, boolean isConnect… in recvfrom() argument
551 … InetSocketAddress srcAddress = (packet != null && !isConnected) ? new InetSocketAddress() : null; in recvfrom()
553 result = postRecvfrom(isRead, packet, isConnected, srcAddress, result); in recvfrom()
560 … isRead, FileDescriptor fd, ByteBuffer buffer, int flags, DatagramPacket packet, boolean isConnect… in recvfrom() argument
563 … InetSocketAddress srcAddress = (packet != null && !isConnected) ? new InetSocketAddress() : null; in recvfrom()
565 result = postRecvfrom(isRead, packet, isConnected, srcAddress, result); in recvfrom()
572 …private static int postRecvfrom(boolean isRead, DatagramPacket packet, boolean isConnected, InetSo… in postRecvfrom() argument
576 if (packet != null) { in postRecvfrom()
577 packet.setReceivedLength(byteCount); in postRecvfrom()
579 packet.setAddress(srcAddress.getAddress()); in postRecvfrom()
[all …]
/libcore/luni/src/test/java/libcore/io/
DOsTest.java386 private static void checkSocketPing(FileDescriptor fd, InetAddress to, byte[] packet, in checkSocketPing() argument
388 int len = packet.length; in checkSocketPing()
389 packet[0] = type; in checkSocketPing()
391 assertEquals(len, Libcore.os.sendto(fd, packet, 0, len, 0, to, 0)); in checkSocketPing()
394 assertEquals(len, Libcore.os.sendto(fd, packet, 0, len, 0, null, 0)); in checkSocketPing()
410 assertArrayEquals(packet, received); in checkSocketPing()
416 final byte[] packet = ("\000\000\000\000" + // ICMP type, code. in test_socketPing()
422 checkSocketPing(fd, ipv6Loopback, packet, ICMPV6_ECHO_REQUEST, ICMPV6_ECHO_REPLY, true); in test_socketPing()
423 checkSocketPing(fd, ipv6Loopback, packet, ICMPV6_ECHO_REQUEST, ICMPV6_ECHO_REPLY, false); in test_socketPing()
427 checkSocketPing(fd, ipv4Loopback, packet, ICMP_ECHO, ICMP_ECHOREPLY, true); in test_socketPing()
[all …]