/** * Receives a packet from this socket and stores it in the argument {@code * pack}. All fields of {@code pack} must be set according to the data * received. If the received data is longer than the packet buffer size it * is truncated. This method blocks until a packet is received or a timeout * has expired. * * @param pack * the {@code DatagramPacket} to store the received data. * @throws IOException * if an error occurs while receiving the packet. */ public synchronized void receive(DatagramPacket pack) throws IOException { checkOpen(); ensureBound(); if (pack == null) { throw new NullPointerException("pack == null"); } if (pendingConnectException != null) { throw new SocketException("Pending connect failure", pendingConnectException); } pack.resetLengthForReceive(); impl.receive(pack); }
/** * Receives a packet from this socket and stores it in the argument {@code * pack}. All fields of {@code pack} must be set according to the data * received. If the received data is longer than the packet buffer size it * is truncated. This method blocks until a packet is received or a timeout * has expired. * * @param pack * the {@code DatagramPacket} to store the received data. * @throws IOException * if an error occurs while receiving the packet. */ public synchronized void receive(DatagramPacket pack) throws IOException { checkOpen(); ensureBound(); if (pack == null) { throw new NullPointerException("pack == null"); } if (pendingConnectException != null) { throw new SocketException("Pending connect failure", pendingConnectException); } pack.resetLengthForReceive(); impl.receive(pack); }
/** * Receives a packet from this socket and stores it in the argument {@code * pack}. All fields of {@code pack} must be set according to the data * received. If the received data is longer than the packet buffer size it * is truncated. This method blocks until a packet is received or a timeout * has expired. * * @param pack * the {@code DatagramPacket} to store the received data. * @throws IOException * if an error occurs while receiving the packet. */ public synchronized void receive(DatagramPacket pack) throws IOException { checkOpen(); ensureBound(); if (pack == null) { throw new NullPointerException("pack == null"); } if (pendingConnectException != null) { throw new SocketException("Pending connect failure", pendingConnectException); } pack.resetLengthForReceive(); impl.receive(pack); }
/** * Receives a packet from this socket and stores it in the argument {@code * pack}. All fields of {@code pack} must be set according to the data * received. If the received data is longer than the packet buffer size it * is truncated. This method blocks until a packet is received or a timeout * has expired. * * @param pack * the {@code DatagramPacket} to store the received data. * @throws IOException * if an error occurs while receiving the packet. */ public synchronized void receive(DatagramPacket pack) throws IOException { checkOpen(); ensureBound(); if (pack == null) { throw new NullPointerException("pack == null"); } if (pendingConnectException != null) { throw new SocketException("Pending connect failure", pendingConnectException); } pack.resetLengthForReceive(); impl.receive(pack); }
/** * Receives a packet from this socket and stores it in the argument {@code * pack}. All fields of {@code pack} must be set according to the data * received. If the received data is longer than the packet buffer size it * is truncated. This method blocks until a packet is received or a timeout * has expired. * * @param pack * the {@code DatagramPacket} to store the received data. * @throws IOException * if an error occurs while receiving the packet. */ public synchronized void receive(DatagramPacket pack) throws IOException { checkOpen(); ensureBound(); if (pack == null) { throw new NullPointerException("pack == null"); } if (pendingConnectException != null) { throw new SocketException("Pending connect failure", pendingConnectException); } pack.resetLengthForReceive(); impl.receive(pack); }
/** * Receives a packet from this socket and stores it in the argument {@code * pack}. All fields of {@code pack} must be set according to the data * received. If the received data is longer than the packet buffer size it * is truncated. This method blocks until a packet is received or a timeout * has expired. * * @param pack * the {@code DatagramPacket} to store the received data. * @throws IOException * if an error occurs while receiving the packet. */ public synchronized void receive(DatagramPacket pack) throws IOException { checkOpen(); ensureBound(); if (pack == null) { throw new NullPointerException("pack == null"); } if (pendingConnectException != null) { throw new SocketException("Pending connect failure", pendingConnectException); } pack.resetLengthForReceive(); impl.receive(pack); }
/** * Receives a packet from this socket and stores it in the argument {@code * pack}. All fields of {@code pack} must be set according to the data * received. If the received data is longer than the packet buffer size it * is truncated. This method blocks until a packet is received or a timeout * has expired. * * @param pack * the {@code DatagramPacket} to store the received data. * @throws IOException * if an error occurs while receiving the packet. */ public synchronized void receive(DatagramPacket pack) throws IOException { checkOpen(); ensureBound(); if (pack == null) { throw new NullPointerException("pack == null"); } if (pendingConnectException != null) { throw new SocketException("Pending connect failure", pendingConnectException); } pack.resetLengthForReceive(); impl.receive(pack); }