/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/luni/src/main/java/java/net/ |
D | PlainDatagramSocketImpl.java | 155 DatagramPacket packet = new DatagramPacket(EmptyArray.BYTE, 0); in peek() local 156 int result = peekData(packet); in peek() 158 sender.ipaddress = packet.getAddress().getAddress(); in peek() 181 public void send(DatagramPacket packet) throws IOException { in send() argument 182 int port = isNativeConnected ? 0 : packet.getPort(); in send() 183 InetAddress address = isNativeConnected ? null : packet.getAddress(); in send() 184 IoBridge.sendto(fd, packet.getData(), packet.getOffset(), packet.getLength(), 0, address, in send() 253 private void updatePacketRecvAddress(DatagramPacket packet) { in updatePacketRecvAddress() argument 254 packet.setAddress(connectedAddress); in updatePacketRecvAddress() 255 packet.setPort(connectedPort); in updatePacketRecvAddress()
|
D | MulticastSocket.java | 248 public void send(DatagramPacket packet, byte ttl) throws IOException { in send() argument 250 InetAddress packAddr = packet.getAddress(); in send() 255 impl.send(packet); in send() 260 impl.send(packet); in send()
|
/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 | 549 …, byte[] bytes, int byteOffset, int byteCount, int flags, DatagramPacket packet, boolean isConnect… in recvfrom() argument 552 … InetSocketAddress srcAddress = (packet != null && !isConnected) ? new InetSocketAddress() : null; in recvfrom() 554 result = postRecvfrom(isRead, packet, isConnected, srcAddress, result); in recvfrom() 561 … isRead, FileDescriptor fd, ByteBuffer buffer, int flags, DatagramPacket packet, boolean isConnect… in recvfrom() argument 564 … InetSocketAddress srcAddress = (packet != null && !isConnected) ? new InetSocketAddress() : null; in recvfrom() 566 result = postRecvfrom(isRead, packet, isConnected, srcAddress, result); in recvfrom() 573 …private static int postRecvfrom(boolean isRead, DatagramPacket packet, boolean isConnected, InetSo… in postRecvfrom() argument 577 if (packet != null) { in postRecvfrom() 578 packet.setReceivedLength(byteCount); in postRecvfrom() 580 packet.setAddress(srcAddress.getAddress()); in postRecvfrom() [all …]
|
/libcore/luni/src/main/java/java/nio/ |
D | DatagramChannelImpl.java | 573 public void receive(DatagramPacket packet) throws IOException { in receive() argument 579 super.receive(packet); in receive() 588 public void send(DatagramPacket packet) throws IOException { in send() argument 596 super.send(packet); in send()
|