Package DebTorrent :: Package BT1 :: Module Connecter :: Class Connecter
[hide private]
[frames] | no frames]

Class Connecter

source code

A collection of all connections to peers.

Instance Methods [hide private]
 
__init__(self, make_upload, downloader, choker, numpieces, totalup, config, ratelimiter, sched=None) source code
int
how_many_connections(self)
Get the number of currently open connections.
source code
Connection
connection_made(self, connection)
Make a new connection.
source code
 
connection_lost(self, connection)
Process a lost connection.
source code
 
connection_flushed(self, connection)
Process a flushed connection.
source code
 
got_piece(self, i)
Alert all the open connections that a piece was received.
source code
 
got_message(self, connection, message)
Process a received message on a connection.
source code
Instance Variables [hide private]
int ccount
the largest connection number used
Choker.Choker choker
the Choker instance to use
dictionary config
the configration information
dictionary connections
the collection of connections that are open
Downloader.Downloader downloader
the Downloader instance to use
int external_connection_made
greater than 0 if there have been external connections
method make_upload
the method to create a new Uploader.Upload
int numpieces
the number of pieces in the download
boolean rate_capped
not used
RateLimiter.RateLimiter ratelimiter
the RateLimiter instance to use
method sched
the method to call to schedule future actions (not used)
Debtorrent.CurrentRateMeasure.Measure totalup
the Measure instance to use
Method Details [hide private]

__init__(self, make_upload, downloader, choker, numpieces, totalup, config, ratelimiter, sched=None)
(Constructor)

source code 
Parameters:

how_many_connections(self)

source code 
Get the number of currently open connections.
Returns: int
the number of open connections

connection_made(self, connection)

source code 
Make a new connection.
Parameters:
Returns: Connection
the new connection

connection_lost(self, connection)

source code 
Process a lost connection.
Parameters:

connection_flushed(self, connection)

source code 
Process a flushed connection.
Parameters:

got_piece(self, i)

source code 
Alert all the open connections that a piece was received.
Parameters:
  • i (int) - the piece index that was received

got_message(self, connection, message)

source code 
Process a received message on a connection.
Parameters:
  • connection (Encrypter.Connection) - the connection that the message was received on
  • message (string) - the message that was received