Code example for SocketTimeoutException

0
                // receiveDatagramImpl2 
                netImpl.receiveDatagram(fd, pack, pack.getData(), pack.getOffset(), pack
                        .getLength(), receiveTimeout, false);
            } 
        } catch (InterruptedIOException e) {
            throw new SocketTimeoutException(e.getMessage());
        } 
    } 
 
    @Override 
    public void send(DatagramPacket packet) throws IOException {
 
        if (isNativeConnected) {
            netImpl.sendConnectedDatagram(fd, packet.getData(), packet.getOffset(), packet
                    .getLength(), bindToDevice);
        } else { 
            // sendDatagramImpl2 
            netImpl.sendDatagram(fd, packet.getData(), packet.getOffset(), packet.getLength(),
                    packet.getPort(), bindToDevice, trafficClass, packet.getAddress());
        } 
    }