]> git.seodisparate.com - UDPConnection/commitdiff
Revert heartbeat interval fn, Version 1.5 1.5
authorStephen Seo <seo.disparate@gmail.com>
Thu, 13 Mar 2025 08:37:17 +0000 (17:37 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Thu, 13 Mar 2025 08:37:17 +0000 (17:37 +0900)
CMakeLists.txt
src/UDPC.h
src/UDPConnection.cpp

index d1641e1c7fa27b1eac4280886daf9d28e1c119cb..052decea6bab46ea41e6230ee2159e5e7c607714 100644 (file)
@@ -1,7 +1,7 @@
 cmake_minimum_required(VERSION 3.10)
 project(UDPC)
 
-set(UDPC_VERSION 1.4)
+set(UDPC_VERSION 1.5)
 set(UDPC_SOVERSION 1)
 
 set(UDPC_SOURCES
index 68648e63366571e2fe39a9a87699f46e64ec0927..624c6123c52412505436c838e9e8ad5d66856379 100644 (file)
@@ -926,22 +926,14 @@ UDPC_EXPORT void UDPC_atostr_unsafe_free(const char *addrBuf);
 UDPC_EXPORT void UDPC_atostr_unsafe_free_ptr(const char **addrBuf);
 
 /*!
- * \brief Sets the amount of time between heartbeat packets.
+ * \brief REVERTED FUNCTION, SEE DETAILS.
  *
- * By default, UDPC sends a heartbeat packet every 150 milliseconds.
- * This function can be used to increase the heartbeat interval time.
- * Valid values are between 150 to 5000 milliseconds. Any value outside of this
- * range will be clamped to within this range.
+ * This function and its provided functionality was deemed premature for
+ * production use. This function will therefore be a no-op until the feature
+ * is implemented and ready.
  *
- * This function affects all connections associated with the given UDPC Context.
- *
- * This is useful for cases where low-latency is not required. Also note that
- * increasing the heartbeat interval may prevent UDPC from entering "good mode"
- * for any connection. (See <a href="#details">details</a> for info on "good
- * mode" and "bad mode".)
- *
- * \return 0 on success, 1 if clamped to minimum, 2 if clamped to maximum, -1
- * if the given context is invalid.
+ * \return -1 always, indicating that this function does not yet work as
+ * intended.
  */
 UDPC_EXPORT int UDPC_set_heartbeat_millis(UDPC_HContext ctx, unsigned int millis);
 
index 02676b507ceb552e427bebf87ba6787c8005c6ef..0b44b2c1097d2c24e4e6fd285fb4c4fe6d516983 100644 (file)
@@ -2840,25 +2840,8 @@ void UDPC_atostr_unsafe_free_ptr(const char **addrBuf) {
 }
 
 int UDPC_set_heartbeat_millis(UDPC_HContext ctx, unsigned int millis) {
-    UDPC::Context *c = UDPC::verifyContext(ctx);
-    if (!c) {
-        return -1;
-    }
-
-    int ret = 0;
-
-    if (millis < 150) {
-        millis = 150;
-        ret = 1;
-    } else if (millis > 5000) {
-        millis = 5000;
-        ret = 2;
-    }
-
-    std::unique_lock<std::shared_mutex> lock(c->heartbeatMutex);
-    c->heartbeatDuration = std::chrono::milliseconds(millis);
-
-    return ret;
+    // No-op for now, see docs for details.
+    return -1;
 }
 
 UDPC_IPV6_ADDR_TYPE UDPC_strtoa(const char *addrStr) {