p2p/network.js
function getOnLinePeers()
{
	var arrOnlinePeers = [];
	function compare(){
		return function(a,b){
			return b['count'] - a['count'];
		}
	}

	Object.keys(assocOnlinePeers).forEach(function(curUrl){    
		arrOnlinePeers.push({peer:curUrl, count:assocOnlinePeers[curUrl]});
	})
	if(arrOnlinePeers.length === 0)
		return [];
	else
		return arrOnlinePeers.sort(compare());
}
function getOnLinePeers()
{
	var arrOnlinePeers = [];
	function compare(){
		return function(a,b){
			return b['count'] - a['count'];
		}
	}

	Object.keys(assocOnlinePeers).forEach(function(curUrl){    
		arrOnlinePeers.push({peer:curUrl, count:assocOnlinePeers[curUrl]});
	})
	if(arrOnlinePeers.length === 0)
		return [];
	else
		return arrOnlinePeers.sort(compare());
}
function getOnLinePeers ( ) { var arrOnlinePeers = [ ] ; function compare ( ) { return function ( a , b ) { return b [ 'count' ] - a [ 'count' ] ; } } Object . keys ( assocOnlinePeers ) . forEach ( function ( curUrl ) { arrOnlinePeers . push ( { peer : curUrl , count : assocOnlinePeers [ curUrl ] } ) ; } ) if ( arrOnlinePeers . length === 0 ) return [ ] ; else return arrOnlinePeers . sort ( compare ( ) ) ; }
Gets the online node, sorted by count
Gets the online node sorted by count