Code example for BlockingQueue

Methods: put

0
            try { 
                if (isServer) {
                    acceptQueue.put(new AcceptData(true));
                    serverSocket.close();
                } else { 
                    readQueue.put(new ReadData(true));
                    if(type == Type.TCP) {
                        tcpSocket.close();
                    } else { 
                        udpSocket.close();
                    } 
                } 
            } catch (IOException ioe) {
            } catch (InterruptedException ie) {
            } 
            tcpSocket = null;
            udpSocket = null;
            serverSocket = null;
        } 
 
        public void destroy() {