Skip to content

Commit

Permalink
event/net/BufferedSocket: add methods Is{Read,Write}Pending()
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Nov 17, 2023
1 parent db3b08e commit 5472ea3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/event/net/BufferedSocket.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,16 @@ public:
return base.IsReadyForWriting();
}

[[gnu::pure]]
bool IsReadPending() const noexcept {
return base.IsReadPending() || defer_read.IsPending();
}

[[gnu::pure]]
bool IsWritePending() const noexcept {
return base.IsWritePending() || defer_write.IsPending();
}

/**
* Defer a call to Read().
*/
Expand Down

0 comments on commit 5472ea3

Please sign in to comment.