diff --git a/src/uvw/stream.hpp b/src/uvw/stream.hpp index e4de2f62..8ae28ec1 100644 --- a/src/uvw/stream.hpp +++ b/src/uvw/stream.hpp @@ -445,6 +445,14 @@ public: bool blocking(bool enable = false) { return (0 == uv_stream_set_blocking(this->template get(), enable)); } + + /** + * @brief Gets the amount of queued bytes waiting to be sent. + * @return Amount of queued bytes waiting to be sent. + */ + size_t writeQueueSize() const noexcept { + return uv_stream_get_write_queue_size(this->template get()); + } }; diff --git a/src/uvw/udp.hpp b/src/uvw/udp.hpp index eccb0f41..9baafa95 100644 --- a/src/uvw/udp.hpp +++ b/src/uvw/udp.hpp @@ -593,6 +593,25 @@ public: invoke(&uv_udp_recv_stop, get()); } + /** + * @brief Gets the number of bytes queued for sending. + * + * It strictly shows how much information is currently queued. + * + * @return Number of bytes queued for sending. + */ + size_t sendQueueSize() const noexcept { + return uv_udp_get_send_queue_size(get()); + } + + /** + * @brief Number of send requests currently in the queue awaiting to be processed. + * @return Number of send requests currently in the queue. + */ + size_t sendQueueCount() const noexcept { + return uv_udp_get_send_queue_count(get()); + } + private: enum { DEFAULT, FLAGS } tag{DEFAULT}; unsigned int flags{};