FalkTannhaeuser / python-onvif-zeep

ONVIF Client Implementation in Python 2+3 (using https://github.com/mvantellingen/python-zeep instead of suds as SOAP client)
MIT License
424 stars 138 forks source link

how does set request timeout in ONVIFCamera #41

Closed beruhan closed 5 years ago

beruhan commented 5 years ago

I want to control timeout,but I don't known how to set

Lanyaaki commented 3 years ago

https://docs.python-zeep.org/en/master/transport.html#session-timeout

nikolaevigor commented 3 years ago

for future googlers:

from zeep.transports import Transport
transport = Transport(timeout=10)
onvif_client = ONVIFCamera(
    <ip here>,
    <port here>,
    login,
    password,
    wsdl_dir=WSDL_DIR_PATH,
    transport=transport
)
qwxr commented 1 year ago

from zeep.transports import Transport transport=Transport(operation_timeout=2)

302sk commented 1 year ago

@qwxr Thanks, it works for me.