简体   繁体   中英

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.

In the documentation , the only option that's shown in example is: dir .

I can also use out to specify the filename, now I wonder how to config things like -timeout and --connect-timeout .

I've tried timeout and connect_timeout , but that doesn't work.

You need to set timeout on the socket library level:

import socket
socket.setdefaulttimeout(<your_value>)

This value will be used by xmlrpclib .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM