Searched refs:packet (Results 1 - 8 of 8) sorted by relevance

/libcore/luni/src/test/java/libcore/java/net/
H A DOldAndroidDatagramTest.java48 DatagramPacket packet; field in class:OldAndroidDatagramTest.Reflector
58 packet.setLength(buffer.length);
59 socket.receive(packet);
60 String s = stringFromPacket(packet);
61 // System.out.println(s + " (from " + packet.getAddress() + ":" + packet.getPort() + ")");
69 stringToPacket(s.toUpperCase(), packet);
71 packet.setAddress(InetAddress.getLocalHost());
72 packet.setPort(2345);
74 socket.send(packet);
102 stringFromPacket(DatagramPacket packet) argument
109 stringToPacket(String s, DatagramPacket packet) argument
[all...]
H A DOldDatagramPacketTest.java35 DatagramPacket packet = new DatagramPacket(new byte[256], 256);
37 ss.receive(packet);
38 ss.send(packet);
49 DatagramPacket packet = new DatagramPacket(bytes, 6, InetAddress.getByName("localhost"), ss.getLocalPort());
50 cs.send(packet);
52 cs.receive(packet);
54 assertEquals(packet.getPort(), ss.getLocalPort());
/libcore/luni/src/main/java/libcore/net/
H A DRawSocket.java49 String interfaceName, short protocolType, byte[] destMac, byte[] packet,
51 private static native int recvPacket(FileDescriptor fd, byte[] packet, argument
72 * Reads a raw packet into the specified buffer, with the
77 * The packet data will start at the IP header (EthernetII
80 public int read(byte[] packet, int offset, int byteCount, int destPort, argument
82 if (packet == null) {
83 throw new NullPointerException("packet == null");
86 Arrays.checkOffsetAndCount(packet.length, offset, byteCount);
93 return recvPacket(fd, packet, offset, byteCount, destPort,
98 * Writes a raw packet t
48 sendPacket(FileDescriptor fd, String interfaceName, short protocolType, byte[] destMac, byte[] packet, int offset, int byteCount) argument
103 write(byte[] destMac, byte[] packet, int offset, int byteCount) argument
[all...]
/libcore/luni/src/main/java/java/net/
H A DPlainDatagramSocketImpl.java153 DatagramPacket packet = new DatagramPacket(EmptyArray.BYTE, 0);
154 int result = peekData(packet);
156 sender.ipaddress = packet.getAddress().getAddress();
179 public void send(DatagramPacket packet) throws IOException { argument
180 int port = isNativeConnected ? 0 : packet.getPort();
181 InetAddress address = isNativeConnected ? null : packet.getAddress();
182 IoBridge.sendto(fd, packet.getData(), packet.getOffset(), packet.getLength(), 0, address, port);
228 * Set the received address and port in the packet
236 updatePacketRecvAddress(DatagramPacket packet) argument
[all...]
H A DMulticastSocket.java238 * Sends the given {@code packet} on this socket, using the given {@code ttl}. This method is
245 public void send(DatagramPacket packet, byte ttl) throws IOException { argument
247 InetAddress packAddr = packet.getAddress();
252 impl.send(packet);
257 impl.send(packet);
/libcore/luni/src/main/native/
H A Dlibcore_net_RawSocket.cpp96 * Writes the L3 (IP) packet to the raw socket supplied in the
103 jbyteArray packet, jint offset, jint byteCount)
116 ScopedByteArrayRO byteArray(env, packet);
147 * Reads a network packet into the user-supplied buffer. Return the
148 * length of the packet, or a 0 if there was a timeout or an
149 * unacceptable packet was acquired.
154 jbyteArray packet, jint offset, jint byteCount, jint port,
162 ScopedByteArrayRW body(env, packet);
192 // the packet is an IP header, UDP header, and UDP payload
194 return 0; // runt packet
101 RawSocket_sendPacket(JNIEnv* env, jclass, jobject fileDescriptor, jstring interfaceName, jshort protocolType, jbyteArray destMac, jbyteArray packet, jint offset, jint byteCount) argument
153 RawSocket_recvPacket(JNIEnv* env, jclass, jobject fileDescriptor, jbyteArray packet, jint offset, jint byteCount, jint port, jint timeout_millis) argument
[all...]
/libcore/luni/src/main/java/libcore/io/
H A DIoBridge.java502 public static int recvfrom(boolean isRead, FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, DatagramPacket packet, boolean isConnected) throws IOException { argument
505 InetSocketAddress srcAddress = (packet != null && !isConnected) ? new InetSocketAddress() : null;
507 result = postRecvfrom(isRead, packet, isConnected, srcAddress, result);
514 public static int recvfrom(boolean isRead, FileDescriptor fd, ByteBuffer buffer, int flags, DatagramPacket packet, boolean isConnected) throws IOException { argument
517 InetSocketAddress srcAddress = (packet != null && !isConnected) ? new InetSocketAddress() : null;
519 result = postRecvfrom(isRead, packet, isConnected, srcAddress, result);
526 private static int postRecvfrom(boolean isRead, DatagramPacket packet, boolean isConnected, InetSocketAddress srcAddress, int byteCount) { argument
530 if (packet != null) {
531 packet.setReceivedLength(byteCount);
533 packet
[all...]
/libcore/luni/src/main/java/java/nio/
H A DDatagramChannelImpl.java172 // receive real data packet, (not peek)
208 // copy the data of received packet
227 // copy the data of received packet
544 public void receive(DatagramPacket packet) throws IOException { argument
548 super.receive(packet);
555 public void send(DatagramPacket packet) throws IOException { argument
559 super.send(packet);

Completed in 261 milliseconds