[英]How to config timeout when using the RPC interface of aria2?
I'm using the xmlrpclib
of Python to interact with aria2
to manage files to download. 我正在使用Python的
xmlrpclib
与aria2
进行交互以管理要下载的文件。
In the documentation , the only option that's shown in example is: dir
. 在文档中 ,示例中显示的唯一选项是:
dir
。
I can also use out
to specify the filename, now I wonder how to config things like -timeout
and --connect-timeout
. 我还可以用
out
指定文件名,现在我想知道如何配置-timeout
和--connect-timeout
类的东西。
I've tried timeout
and connect_timeout
, but that doesn't work. 我已经尝试过
timeout
和connect_timeout
,但这不起作用。
You need to set timeout on the socket
library level: 您需要在
socket
库级别设置超时:
import socket
socket.setdefaulttimeout(<your_value>)
This value will be used by xmlrpclib
. xmlrpclib
将使用此值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.