Code example for DatagramSocket

Methods: isBoundisClosed

0
    protected boolean work() 
    { 
        // Check state before doing work 
        if (mSocket == null)
            return false; 
        if (!mSocket.isBound())
            return false; 
        if (mSocket.isClosed())
            return false; 
 
        try 
        { 
            return sendPacket(mPacketSendQueue.take());
        } 
        catch (InterruptedException e)
        { 
            return false; 
        } 
    }