Code example for LinkedBlockingQueue

Methods: take

0
        if (mSocket.isClosed())
            return false; 
 
        try 
        { 
            return sendPacket(mPacketSendQueue.take());
        } 
        catch (InterruptedException e)
        { 
            return false; 
        } 
    } 
 
    /** 
     * Add a packet to the send queue. This will add the address and port to the packet 
     *  
     * @param data 
     * @param length 
     * @return true if added to the queue.. does not mean the packet has been sent tho! 
     */ 
    boolean addPacketToSend(byte[] data, int length)