diff --git a/CMakeLists.txt b/CMakeLists.txt index 698739c2..6ae840e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ endif() # Project configuration # set(UVW_VERSION_MAJOR 2) -set(UVW_VERSION_MINOR 7) +set(UVW_VERSION_MINOR 8) set(UVW_VERSION_PATCH 0) project( @@ -71,7 +71,7 @@ function(fetch_libuv) FetchContent_Declare( libuv GIT_REPOSITORY https://github.com/libuv/libuv.git - GIT_TAG v1.39.0 + GIT_TAG v1.40.0 GIT_SHALLOW 1 ) diff --git a/conanfile.py b/conanfile.py index 38b1bbed..3e5d5d4d 100644 --- a/conanfile.py +++ b/conanfile.py @@ -14,7 +14,7 @@ class UVMConan(ConanFile): exports = "LICENSE" exports_sources = "src/*" no_copy_source = True - requires = "libuv/1.39.0@bincrafters/stable" + requires = "libuv/1.40.0@bincrafters/stable" def package(self): self.copy(pattern="LICENSE", dst="licenses") diff --git a/src/uvw/timer.cpp b/src/uvw/timer.cpp index 60b7c053..654fa4aa 100644 --- a/src/uvw/timer.cpp +++ b/src/uvw/timer.cpp @@ -44,4 +44,9 @@ UVW_INLINE TimerHandle::Time TimerHandle::repeat() { } +UVW_INLINE TimerHandle::Time TimerHandle::dueIn() { + return Time{uv_timer_get_due_in(get())}; +} + + } diff --git a/src/uvw/timer.h b/src/uvw/timer.h index b1fbb437..e9dd9076 100644 --- a/src/uvw/timer.h +++ b/src/uvw/timer.h @@ -94,6 +94,15 @@ public: * `std::chrono::duration`). */ Time repeat(); + + /** + * @brief Gets the timer due value. + * + * The time is relative to `Loop::now()`. + * + * @return The timer due value or 0 if it has expired. + */ + Time dueIn(); }; diff --git a/src/uvw/udp.h b/src/uvw/udp.h index 60420573..94942c9c 100644 --- a/src/uvw/udp.h +++ b/src/uvw/udp.h @@ -47,6 +47,7 @@ enum class UVUDPFlags: std::underlying_type_t { UDP_PARTIAL = UV_UDP_PARTIAL, REUSEADDR = UV_UDP_REUSEADDR, UDP_MMSG_CHUNK = UV_UDP_MMSG_CHUNK, + UDP_MMSG_FREE = UV_UDP_MMSG_FREE, UDP_RECVMMSG = UV_UDP_RECVMMSG }; @@ -149,6 +150,8 @@ public: * * `UDPHandle::Bind::IPV6ONLY` * * `UDPHandle::Bind::UDP_PARTIAL` * * `UDPHandle::Bind::REUSEADDR` + * * `UDPHandle::Bind::UDP_MMSG_CHUNK` + * * `UDPHandle::Bind::UDP_MMSG_FREE` * * `UDPHandle::Bind::UDP_RECVMMSG` * * See the official @@ -233,6 +236,7 @@ public: * * `UDPHandle::Bind::UDP_PARTIAL` * * `UDPHandle::Bind::REUSEADDR` * * `UDPHandle::Bind::UDP_MMSG_CHUNK` + * * `UDPHandle::Bind::UDP_MMSG_FREE` * * `UDPHandle::Bind::UDP_RECVMMSG` * * See the official @@ -255,6 +259,7 @@ public: * * `UDPHandle::Bind::UDP_PARTIAL` * * `UDPHandle::Bind::REUSEADDR` * * `UDPHandle::Bind::UDP_MMSG_CHUNK` + * * `UDPHandle::Bind::UDP_MMSG_FREE` * * `UDPHandle::Bind::UDP_RECVMMSG` * * See the official