src/com/shrewdify/diaroser/impl/PeerImpl.java
@Override
		public void run() {
			while(true){
				boolean loc=false;
				byte[] b=null;
				if(responseQueue.size()>Constants.ZERO ){
					try{
						loc=responseQueue.getLock();
						if(loc){
							log.debug("Number of responses in queue:"+responseQueue.size());
							b=responseQueue.remove();
						}
					}
					catch(Exception e){
						e.printStackTrace();
					}
					finally{
						if(loc)
							responseQueue.lock.unlock();
					}
					if(b!=null){
						try {
							out.write(b);
							delay(1);
						} catch (IOException e) {
							try {
								PeerImpl.this.stop();
							} catch (IOException e1) {
								e1.printStackTrace();
							}
						} 			
					}
				}
				else
					delay(1);
			}
		}
/**
		 * It starts a thread which continuously checks for the queue size, 
		 * if queue contains some responses it tries to acquire lock on it removes 
		 * the response from queue and release the lock and writes the response to Client.
		 * 
		 */
It starts a thread which continuously checks for the queue size,
if queue contains some responses it tries to acquire lock on it removes
the response from queue and release the lock and writes the response to Client.
It starts a thread which continuously checks for the queue size if queue contains some responses it tries to acquire lock on it removes the response from queue and release the lock and writes the response to Client .
@Override
		public void run() {
			while(true){
				boolean loc=false;
				byte[] b=null;
				if(responseQueue.size()>Constants.ZERO ){
					try{
						loc=responseQueue.getLock();
						if(loc){
							log.debug("Number of responses in queue:"+responseQueue.size());
							b=responseQueue.remove();
						}
					}
					catch(Exception e){
						e.printStackTrace();
					}
					finally{
						if(loc)
							responseQueue.lock.unlock();
					}
					if(b!=null){
						try {
							out.write(b);
							delay(1);
						} catch (IOException e) {
							try {
								PeerImpl.this.stop();
							} catch (IOException e1) {
								e1.printStackTrace();
							}
						} 			
					}
				}
				else
					delay(1);
			}
		}
@ Override public void run ( ) { while ( true ) { boolean loc = false ; byte [ ] b = null ; if ( responseQueue . size ( ) > Constants . ZERO ) { try { loc = responseQueue . getLock ( ) ; if ( loc ) { log . debug ( "Number of responses in queue:" + responseQueue . size ( ) ) ; b = responseQueue . remove ( ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { if ( loc ) responseQueue . lock . unlock ( ) ; } if ( b != null ) { try { out . write ( b ) ; delay ( 1 ) ; } catch ( IOException e ) { try { PeerImpl . this . stop ( ) ; } catch ( IOException e1 ) { e1 . printStackTrace ( ) ; } } } } else delay ( 1 ) ; } }
It starts a thread which continuously checks for the queue size,
 if queue contains some responses it tries to acquire lock on it removes
 the response from queue and release the lock and writes the response to Client.
It starts a thread which continuously checks for the queue size if queue contains some responses it tries to acquire lock on it removes the response from queue and release the lock and writes the response to Client .