Code example for IllegalBlockingModeException

0
         * @see java.net.DatagramSocket#receive(java.net.DatagramPacket) 
         */ 
        @Override 
        public void receive(DatagramPacket packet) throws IOException {
            if (!channelImpl.isBlocking()) {
                throw new IllegalBlockingModeException();
            } 
            super.receive(packet);
        } 
 
        /** 
         * @see java.net.DatagramSocket#send(java.net.DatagramPacket) 
         */ 
        @Override 
        public void send(DatagramPacket packet) throws IOException {
            if (!channelImpl.isBlocking()) {
                throw new IllegalBlockingModeException();
            } 
            super.send(packet);
        }