def create_socket_inet(self): try: controlsocket = RawServer.create_serversocket(56881, '127.0.0.1', reuse=True) except socket.error, e: raise BTFailure("Could not create control socket: "+str(e))
self.rawserver.add_task(self.expire_downloaders, self.timeout_downloaders_interval) def track(args): if len(args) == 0: print formatDefinitions(defaults, 80) return try: config, files = parseargs(args, defaults, 0, 0) except ValueError, e: print 'error: ' + str(e) print 'run with no arguments for parameter explanations' return r = RawServer(Event(), config['timeout_check_interval'], config['socket_timeout'], bindaddr = config['bind']) t = Tracker(config, r) s = r.create_serversocket(config['port'], config['bind'], True) r.start_listening(s, HTTPHandler(t.get, config['min_time_between_log_flushes'])) r.listen_forever() t.save_dfile() print '# Shutting down: ' + isotime() def size_format(s): if (s < 1024): r = str(s) + 'B' elif (s < 1048576): r = str(int(s/1024)) + 'KiB' elif (s < 1073741824): r = str(int(s/1048576)) + 'MiB' elif (s < 1099511627776): r = str(int((s/1073741824.0)*100.0)/100.0) + 'GiB' else:
self.timeout_downloaders_interval) def track(args): if len(args) == 0: print formatDefinitions(defaults, 80) return try: config, files = parseargs(args, defaults, 0, 0) except ValueError, e: print 'error: ' + str(e) print 'run with no arguments for parameter explanations' return r = RawServer(Event(), config) t = Tracker(config, r) s = r.create_serversocket(config['port'], config['bind'], True) r.start_listening( s, HTTPHandler(t.get, config['min_time_between_log_flushes'])) r.listen_forever() t.save_dfile() print '# Shutting down: ' + isotime() def size_format(s): if (s < 1024): r = str(s) + 'B' elif (s < 1048576): r = str(int(s / 1024)) + 'KiB' elif (s < 1073741824): r = str(int(s / 1048576)) + 'MiB' elif (s < 1099511627776):