diff --git a/src/lan/__init__.py b/src/lan/__init__.py index b0ce3234..3ba55908 100644 --- a/src/lan/__init__.py +++ b/src/lan/__init__.py @@ -36,4 +36,5 @@ class LANManager: def start(self): Thread(target=learn_services, args=[self.peers], daemon=True).start() Thread(target=advertise_service, daemon=True).start() + Thread(target=self.too_many.get(Client, (self.peers,)).start, daemon=True).start() diff --git a/src/lan/client/__init__.py b/src/lan/client/__init__.py index 9c8da42f..1a2ee01c 100644 --- a/src/lan/client/__init__.py +++ b/src/lan/client/__init__.py @@ -2,6 +2,9 @@ LAN transport client thread """ +from typing import List + +from utils.bettersleep import better_sleep """ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,5 +22,11 @@ LAN transport client thread class Client: - def __init__(self): + def __init__(self, peer_list: List): + self.peers = peer_list return + + def start(self): + while True: + print(1, self.peers) + better_sleep(1)