From 72cdcf31bd4270736cf3b8d2b83defa833acc848 Mon Sep 17 00:00:00 2001 From: Prodesire Date: Tue, 5 Dec 2017 22:08:53 +0800 Subject: [PATCH] add docstring for request --- pydu/request.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pydu/request.py b/pydu/request.py index 834ed0d..3e87cdf 100644 --- a/pydu/request.py +++ b/pydu/request.py @@ -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)