Sfoglia il codice sorgente

Add UdpServer::setKcp

ithewei 3 anni fa
parent
commit
c637f7492a
1 ha cambiato i file con 11 aggiunte e 0 eliminazioni
  1. 11 0
      evpp/UdpServer.h

+ 11 - 0
evpp/UdpServer.h

@@ -96,6 +96,17 @@ public:
         return sendto(str.data(), str.size(), peeraddr);
     }
 
+#if WITH_KCP
+    void setKcp(kcp_setting_t* setting) {
+        if (setting) {
+            enable_kcp = true;
+            kcp_setting = *setting;
+        } else {
+            enable_kcp = false;
+        }
+    }
+#endif
+
 public:
     std::string             host;
     int                     port;