Code example for LinkedBlockingQueue

Methods: poll

0
	public int getPort() { 
		return port;
	} 
	 
	public DatagramPacket readReceivedPacket() {
		return theReceiveQueue.poll();
	} 
	 
	public DatagramPacket readPacketToSend() {
		return theSendQueue.poll();
	} 
	 
	public boolean receive() { 
		startListeningThread(); 
		return true; 
	} 
	 
	public boolean send(byte[] data, String ip, int port) {
		if(sendingThread == null) {
			startSendingThread(); 
		}