non blocking thread version
Update main.py

Test with long time connection
Merge pull request #2 from Chipsterjulien/patch-1

Patch 1