Skip to content

Added a socket timeout parameter

Hi everyone,

this mergerequest adds a timeout parameter to the MANAGESIEVE class. It allows the user to specify a network timeout, which is applied to the python-socket using socket.settimeout.

Unfortunately it is then no longer possible to open the socket as a file and perform communication through that file, because settimeout puts the socket in non-blocking mode. The timeout is then implemented in recv (this is documented in https://docs.python.org/3/library/socket.html#socket-timeouts). Therefore I had to change the line-splitting logic for unencrypted connections.

It would be great if you could have a look at my proposed changes and maybe consider merging them. Any ideas/change requests/questions/... welcome

Merge request reports