View Single Post
  #8 (permalink)  
Old January 15th, 2010
mrogers mrogers is offline
Devotee
 
Join Date: June 7th, 2008
Posts: 26
mrogers is flying high
Default

Hi Aklilom,

Sounds like an interesting research project. I guess there are two ways you could approach it:

(1) Reserve a certain number of connection slots for geographically close peers. If no geographically close peers are available, allow other peers to occupy those slots. This approach is similar to the way locale preferencing works, so try searching the code for references to ConnectionSettings.USE_LOCALE_PREF to get an idea of where and how locale preferencing is implemented.

(2) When choosing peers to connect to, try geographically close peers first. If you're interested in this approach, look at HostCatcher.getAnEndpointInternal(), which selects the next cached peer that LimeWire will try to connect to. In particular, look at the PriorityComparator class in ExtendedEndpoint, which determines the order in which peers are returned from the HostCatcher's ENDPOINT_QUEUE. You'll need to come up with some way of combining the geographic distance with the other selection criteria (number of successful/failed connection attempts and locale).

Hope this helps,
Michael
Reply With Quote