add docstring for request

This commit is contained in:
Prodesire 2017-12-05 22:08:53 +08:00
parent 306a7ef235
commit 72cdcf31bd
1 changed files with 4 additions and 0 deletions

View File

@ -103,6 +103,10 @@ def download(url, dst=None):
def check_connect(ip, port, retry=1, timeout=0.5):
"""
Check whether given ip and port could connect or not.
It will retry and timeout on given.
"""
while retry:
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)