The application blocks after starting without internet connection
I uses Ubuntu 14.04 and ScudCloud always blocks if there is no internet connection at the app's startup time.
Hi @mendrugory and sorry for the long time to answer you.
This is how the qwebview component works: if no connection, it'll just fail to load the URL after a timeout.
So, an improvement will be required to check when: Slack is not loaded and when the Internet connection changes.
This is a low priority for me now (any help appreciated) and I'll mark it as an improvement.
I recently had to make some program activity dependent on whether or not the internet was up. I used the following snippet:
def internet_up(host="8.8.8.8", port=53):
"""
Host: 8.8.8.8 (google-public-dns-a.google.com)
OpenPort: 53/tcp
Service: domain (DNS/TCP)
"""
try:
with socket.create_connection((host, port), 1):
return True
except Exception:
pass
return False
Would it be sufficient to put a test like this looped in addWrapper()?
https://github.com/raelgc/scudcloud/blob/a319c48232ea607bc34b0bb85db9b854cea1cea9/scudcloud/scudcloud.py#L112
def addWrapper(url):
while not internet_up(...):
time.sleep(20)
I have a similar (but different) problem. I sometimes forget to turn my wifi on in the morning. ScudCloud starts up and displays a blank window - this is expected behaviour. I then realize what I have done, shut down ScudCloud and turn the wifi on. Unfortunately, Scudcloud has left an orphaned process that is still blocked and wont restart. If I kill the process ($ sudo pkill scudcloud ) and restart ScudCloud, it works again.