Skip to content
Snippets Groups Projects
Commit 0b8517e1 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

comReadBuf() supports an infinite timeout (0)

parent 4c33738e
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Loading
  • Maintainer

    This seems very dangerous since it will continue block across a disconnection/new connection. Is that the intended use case?

  • Author Owner

    Yeah, I mentioned the risks to the requester (Nelgin) and he tested and was okay with the change: upon disconnect, the modem is always sending something to the application (SexPOTS), so it always aborts this loop. Still, I made the default timeout non-zero (60 seconds).

  • Maintainer

    While that works fine for his modem usage, I don't understand why he needs more than the 24 days allowed by the timeout value.

    Edited by Deucе
  • Maintainer

    I'm also not sure why his ask is important enough to potentially break existing consumers and/or add a special-case value.

  • Maintainer

    I think passing INT_MAX for infinite timeout would be much better than zero.

  • Author Owner

    I did search and could not locate any caller of this function with a timeout parameter value of 0. Seemed like a safe-enough change but using INT_MAX or INT_MIN is fine too.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment