1. 程式人生 > >python的 http/soap設定超時時間

python的 http/soap設定超時時間

通過web3呼叫本地light模式的geth的RCP埠8584獲取state時相應會比較慢,會出現timeout的問題,通過以下方法解決:

# 設定http超時時間為180s
import socket
timeout = 180
socket.setdefaulttimeout(timeout)