mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 09:18:27 +00:00
Refactor streams: rename is_* to wait_* for clarity (#2069)
- Replace is_readable() with wait_readable() and is_writable() with wait_writable() in the Stream interface. - Implement a new is_readable() function with semantics that more closely reflect its name. It returns immediately whether data is available for reading, without waiting. - Update call sites of is_writable(), removing redundant checks.
This commit is contained in:
parent
a4b2c61a65
commit
550f728165
3 changed files with 45 additions and 33 deletions
|
@ -25,7 +25,9 @@ public:
|
|||
|
||||
bool is_readable() const override { return true; }
|
||||
|
||||
bool is_writable() const override { return true; }
|
||||
bool wait_readable() const override { return true; }
|
||||
|
||||
bool wait_writable() const override { return true; }
|
||||
|
||||
void get_remote_ip_and_port(std::string &ip, int &port) const override {
|
||||
ip = "127.0.0.1";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue