diff options
author | 2024-01-18 19:09:47 +0000 | |
---|---|---|
committer | 2024-01-18 19:09:47 +0000 | |
commit | 1773bb57a92049f839d73852a32e19e34d01fe8c (patch) | |
tree | fca51663ab1cfe42e948182b223bd7ce568d9c98 /include | |
parent | eee965d3aa12dd37b78909a5aaa4d0bee883eb03 (diff) | |
parent | 5a67a56008a340547eac4bb40eeb51b23a6c6f9d (diff) |
Merge "Add InputChannel::waitForMessage and use it in EndToEndNativeInputTest" into main
Diffstat (limited to 'include')
-rw-r--r-- | include/input/InputTransport.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/input/InputTransport.h b/include/input/InputTransport.h index 750e170c24..2d64872beb 100644 --- a/include/input/InputTransport.h +++ b/include/input/InputTransport.h @@ -290,6 +290,17 @@ public: */ bool probablyHasInput() const; + /* Wait until there is a message in the channel. + * + * The |timeout| specifies how long to block waiting for an input event to appear. Negative + * values are not allowed. + * + * In some cases returning before timeout expiration can happen without a message available. + * This could happen after the channel was closed on the other side. Another possible reason + * is incorrect setup of the channel. + */ + void waitForMessage(std::chrono::milliseconds timeout) const; + /* Return a new object that has a duplicate of this channel's fd. */ std::unique_ptr<InputChannel> dup() const; |