Skip to content

Tokio runtime stucks in some circumstances #4389

Answered by Darksonn
manio asked this question in Q&A
Discussion options

You must be logged in to vote

Your read_exact call looks wrong. Try replacing it with one that calls _read instead:

pub async fn read_exact(&self, out: &mut [u8]) -> io::Result<()> {
    while !out.is_empty() {
        let len = self._read(out).await?;
        out = &mut out[len..];
    }
    Ok(())
}

Replies: 1 comment 12 replies

Comment options

You must be logged in to vote
12 replies
@manio
Comment options

@manio
Comment options

@Darksonn
Comment options

@manio
Comment options

@Darksonn
Comment options

Answer selected by manio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants