@Override
	public void run() {
		// TODO Auto-generated method stub
		while(true){
			try {
				int x;
//				while(locked){
//					//x = (int)(Math.random()*99)+100;
//					Thread.sleep(13);
//				}
//				locked = true;
				Thread.sleep(260);
				//listening
				//hear request, send response immediately
				//hear response, save it to the list
				//hear functional method, do as what is bid
				if(heard.size()>0){
					//System.out.println(heard.size());
					for(int i=heard.size()-1;i>=0;i--){
						if(heard.get(i).getStatus().equals("delivered")){
							heard.remove(i);
							break;
						}
						if(heard.get(i).getTarget_node_id().equals(this.id) && heard.get(i).getStatus().equals("created") ){
							
//							this.myHeard.add(new Msg4Test(heard.get(i)));
							Msg4LocalTest msg = heard.get(i);
							msg.setStatus("delivered");
							
							this.myHeard.add(new Msg4LocalTest(msg));
							
							heard.remove(i);
							break;
						}
						//if((heard.get(i).getData()).getString("req_id")==this.id)
					}
				}

				
			} catch (InterruptedException e) {
				System.err.println(e);
				e.printStackTrace();
			} catch (Exception e) {
				System.err.println(e);
				e.printStackTrace();
			}
			
		}

	}