Skip to content

Timeout on receive not working #47

@ghost

Description

Hi,
I'm trying to use a REQ socket to send a message, and then have a timeout on the response in order to handle cases where a response is not sent in time.
When I try it the program hangs after the time passes.

Here is a sample code:

let send_sock = tmq::request(&tme::Context::new()).connect("ipc://test.ipc")?;
let message: tmq::Message = "Hello".into();
let rec_sock = send_sock.send(message.into()).await?;
let (multipart, send_sock) = tokio::time::timeout(Duration::from_secs(1), recv_sock.recv()).await??;
...

I also tried to implement the same logic using tokio::select! and the result was similar.

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