the forums at degreez.net

It is currently Fri Apr 19, 2024 2:13 pm

All times are UTC - 7 hours [ DST ]




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
PostPosted: Fri Jul 09, 2004 12:43 pm 
I notice that my ISP logs the amount of usage on each port. That means that using bittorrent with the same range results in the first 2 or 3 ports of that range being the major consumers. In order to spread some confusion, I thought to randomize the port I'm using. Well, it turned out to be two lines of change:

SocketHandler.py
< from random import shuffle
to
> from random import shuffle, sample

< for listen_port in xrange(minport, maxport+1):
to
> for listen_port in sample(xrange(minport, maxport+1), maxport-minport):

This should randomize the list and then start walking through it, looking for a port that's unbound. It should not duplicate entries and should cover all the ports in the range.

This change makes every run allocate a random port, and it should instead be set a runtime option (i.e. --random_port), I imagine. I only wanted random ports, so I didn't go that far.


It would also be neat to make launchmany allocate a random port to each file you're swarming, though this is a lot more work. I know a lot of people were all stoked about having a single port for all the torrents, but it's not that important. I also thought that maybe changing to another random port at some interval, but again, this is a lot of work.


Top
  
 
 Post subject:
PostPosted: Fri Jul 09, 2004 5:59 pm 
Offline

Joined: Sun Mar 07, 2004 10:05 am
Posts: 1212
That sort of thing is planned for the future. Please note, though that even if you're running on a random port, the people you connect to may not be.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 106 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group