~smaioli/azureus/ubuntu-experimental

« back to all changes in this revision

Viewing changes to com/aelitis/azureus/core/peermanager/peerdb/PeerDatabase.java

MergedĀ VuzeĀ 4.2.0.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
206
206
          }
207
207
  }
208
208
  
 
209
  public PeerItem[]
 
210
  getDiscoveredPeers(
 
211
        String  address )
 
212
  {
 
213
          List<PeerItem>        result = null;
 
214
          
 
215
          try{  
 
216
                  map_mon.enter();
 
217
          
 
218
                  for (int i=0;i<discovered_peers.size();i++){
 
219
                          
 
220
                          PeerItem peer = (PeerItem)discovered_peers.get(i);
 
221
                          
 
222
                          if( peer.getIP().equals( address )){
 
223
                                  
 
224
                                  if ( result == null ){
 
225
                                          
 
226
                                          result = new ArrayList<PeerItem>();
 
227
                                  }
 
228
                                  
 
229
                                  result.add( peer );
 
230
                          }
 
231
                  }
 
232
          }finally{  
 
233
                
 
234
                  map_mon.exit();  
 
235
          }
 
236
          
 
237
          if ( result == null ){
 
238
                  
 
239
                  return( new PeerItem[0]);
 
240
                  
 
241
          }else{
 
242
                  
 
243
                  return( result.toArray( new PeerItem[result.size()] ));
 
244
 
 
245
          }
 
246
  }
 
247
  
209
248
  public int
210
249
  getDiscoveredPeerCount()
211
250
  {