handle ping missed in lan connecting
This commit is contained in:
parent
c0b72f9007
commit
bae8b38f08
@ -45,11 +45,12 @@ def _lan_work(peer: LANIP):
|
||||
except requests.exceptions.ConnectionError:
|
||||
pass
|
||||
|
||||
Thread(target=find_port, args=[1024, 32767], daemon=True).start()
|
||||
Thread(target=find_port, args=[32767, 65535], daemon=True).start()
|
||||
while identified_port.port == 0:
|
||||
better_sleep(1)
|
||||
print(LANIP, identified_port.port)
|
||||
#Thread(target=find_port, args=[1024, 32767], daemon=True).start()
|
||||
#Thread(target=find_port, args=[32767, 65535], daemon=True).start()
|
||||
#while identified_port.port == 0:
|
||||
# better_sleep(1)
|
||||
i = 1337
|
||||
print(requests.get(f'http://{peer}:{i}/ping'))
|
||||
|
||||
|
||||
def connect_peer(peer: LANIP):
|
||||
|
@ -70,7 +70,7 @@ class LANServer:
|
||||
return accept_upload(request)
|
||||
|
||||
def start_server(self):
|
||||
self.server = WSGIServer((self.host, get_open_port()),
|
||||
self.server = WSGIServer((self.host, 1337),
|
||||
self.app, log=None,
|
||||
handler_class=FDSafeHandler)
|
||||
self.port = self.server.server_port
|
||||
|
Loading…
Reference in New Issue
Block a user