Skip to content

Potentially confusing read_exact timeout semantics #177

Open
@RossSmyth

Description

@RossSmyth

Since this library uses the default_read_exact implementation, read_exact has different timeout semantics compared to read. Since the implementation of this default method is to call read in a loop, each loop has a new timeout. This could potentially lead to confusing timeouts:

  1. Set some baud & timeout. Say 9600 bps and 110ms
  2. Call read_exact with 100 bytes. This would mean it would take about 100ms for a full transfer if each byte is contiguous
  3. In the degenerate case, one byte could come every 109ms, leading to the method call hanging for ~11s.

At minimum this should be documented somewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions