httplib.HTTPConnection 的 timeout

文件寫預設用 global timeout
https://docs.python.org/2/library/httplib.html

但 global timeout 是多少?

查了下預設是 socket._GLOBAL_DEFAULT_TIMEOUT
但沒看到 _GLOBAL_DEFAULT_TIMEOUT 是多少

再往下查才發現是 none, socket getdefaulttimeout 是 none
https://docs.python.org/2/library/socket.html

 

會查這些是因為 conn.getresponse().read() 有時會卡死QQ

為了讓它出來只好設定 timeout

arrow
arrow
    全站熱搜

    JohnDX 發表在 痞客邦 留言(0) 人氣()