Timing tweaks

This commit is contained in:
TheKysek 2016-07-19 09:23:52 +02:00
parent 33b0f294ef
commit 71a2dd95f1
2 changed files with 2 additions and 4 deletions

View File

@ -11,7 +11,7 @@ class Advertiser(threading.Thread):
def run(self): def run(self):
while True: while True:
time.sleep(0.6) time.sleep(0.4)
self._advertise_vectors() self._advertise_vectors()
self._advertise_addresses() self._advertise_addresses()

View File

@ -47,7 +47,7 @@ class Connection(threading.Thread):
self._connect() self._connect()
if self.status != 'connected': if self.status != 'connected':
return return
self.s.settimeout(1) self.s.settimeout(0.5)
if not self.server: if not self.server:
self.send_queue.put(message.Version(self.host, self.port)) self.send_queue.put(message.Version(self.host, self.port))
while True: while True:
@ -95,9 +95,7 @@ class Connection(threading.Thread):
logging.debug('{}:{} <- {}'.format(self.host, self.port, structure.Object.from_message(m))) logging.debug('{}:{} <- {}'.format(self.host, self.port, structure.Object.from_message(m)))
else: else:
logging.debug('{}:{} <- {}'.format(self.host, self.port, m)) logging.debug('{}:{} <- {}'.format(self.host, self.port, m))
self.s.settimeout(60)
self.s.sendall(m.to_bytes()) self.s.sendall(m.to_bytes())
self.s.settimeout(1)
def _send_big_inv(self): def _send_big_inv(self):
with shared.objects_lock: with shared.objects_lock: