Skip to content

Wrongful IDLE timeout reset on response #300

@gin-ahirsch

Description

@gin-ahirsch

I'm connecting to an IMAP server that boots IDLE connections after 30 minutes. I'm using imap-3.0.0-alpha.14, pretty much straight forward

    let imap = client.login(username, password)?;
    let mbox = imap.select(inbox)?;
    imap.idle().wait_while(|response| { ... });

I works well, apart from getting booted periodically.

I believe the issue may be, that the time is not counted from the start of the IDLE loop, but for every read, since the timeout is implemented by calling TcpStream::set_read_timeout() once before the loop. So when a response arrives on the client, the timeout is effectively reset.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions