diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-03-27 15:30:17 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-03-27 16:36:44 +0200 |
commit | 0e528676683a0df96751fd0daa018e0818baa0e2 (patch) | |
tree | a8e9e3707ea37a6431a6aac90b7c91a31ee8b567 /core/io/stream_peer_tcp.h | |
parent | a5eed70fa2edcf755d6abea2077232e38381449b (diff) |
[Net] Make StreamPeerTCP::_poll_connection explicit.
No longer hacked into `get_status` and renamed to `poll`.
The old `poll` (for *nix `poll`, win `select`) is now called `wait`.
Diffstat (limited to 'core/io/stream_peer_tcp.h')
-rw-r--r-- | core/io/stream_peer_tcp.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/io/stream_peer_tcp.h b/core/io/stream_peer_tcp.h index f2c47b25cf..5fe1734faa 100644 --- a/core/io/stream_peer_tcp.h +++ b/core/io/stream_peer_tcp.h @@ -56,7 +56,6 @@ protected: uint16_t peer_port = 0; Error _connect(const String &p_address, int p_port); - Error _poll_connection(); Error write(const uint8_t *p_data, int p_bytes, int &r_sent, bool p_block); Error read(uint8_t *p_buffer, int p_bytes, int &r_received, bool p_block); @@ -74,12 +73,15 @@ public: void disconnect_from_host(); int get_available_bytes() const override; - Status get_status(); + Status get_status() const; void set_no_delay(bool p_enabled); - // Poll functions (wait or check for writable, readable) - Error poll(NetSocket::PollType p_type, int timeout = 0); + // Poll socket updating its state. + Error poll(); + + // Wait or check for writable, readable. + Error wait(NetSocket::PollType p_type, int timeout = 0); // Read/Write from StreamPeer Error put_data(const uint8_t *p_data, int p_bytes) override; |