Ejemplo n.º 1
0
 /**
  * Receives a <tt>DatagramPacket</tt> from this <tt>DatagramSocket</tt> upon request from a
  * specific <tt>MultiplexedDatagramSocket</tt>.
  *
  * @param multiplexed the <tt>MultiplexedDatagramSocket</tt> which requests the receipt of a
  *     <tt>DatagramPacket</tt> from the network
  * @param p the <tt>DatagramPacket</tt> to receive the data from the network
  * @throws IOException if an I/O error occurs
  */
 void receive(MultiplexedDatagramSocket multiplexed, DatagramPacket p) throws IOException {
   receive(multiplexed.received, p);
 }
Ejemplo n.º 2
0
 /**
  * Receives a datagram packet from this socket. The <tt>DatagramPacket</tt>s returned by this
  * method do not match any of the <tt>DatagramPacketFilter</tt>s of the
  * <tt>MultiplexedDatagramSocket</tt>s associated with this instance at the time of their receipt.
  * When this method returns, the <tt>DatagramPacket</tt>'s buffer is filled with the data
  * received. The datagram packet also contains the sender's IP address, and the port number on the
  * sender's machine.
  *
  * <p>This method blocks until a datagram is received. The <tt>length</tt> field of the datagram
  * packet object contains the length of the received message. If the message is longer than the
  * packet's length, the message is truncated.
  *
  * @param p the <tt>DatagramPacket</tt> into which to place the incoming data
  * @throws IOException if an I/O error occurs
  * @see DatagramSocket#receive(DatagramPacket)
  */
 @Override
 public void receive(DatagramPacket p) throws IOException {
   receive(received, p);
 }