Erixonich commented on code in PR #7478:
URL: https://github.com/apache/ignite-3/pull/7478#discussion_r2736129092


##########
modules/platforms/cpp/tests/fake_server/fake_server.h:
##########
@@ -43,19 +42,33 @@ class fake_server {
         : m_srv_port(srv_port)
         , m_logger(std::move(logger))
         , m_op_type_handler(op_type_handler)
-    {}
+    {
+#ifdef _WIN32
+        static bool wsa_initialized = false;
+        if (!wsa_initialized) {
+            WSADATA wsaData;
+            if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
+                throw ignite_error("WSAStartup failed");
+            }
+            wsa_initialized = true;
+        }
+#endif

Review Comment:
   done



##########
modules/platforms/cpp/tests/fake_server/fake_server.h:
##########
@@ -43,19 +42,33 @@ class fake_server {
         : m_srv_port(srv_port)
         , m_logger(std::move(logger))
         , m_op_type_handler(op_type_handler)
-    {}
+    {
+#ifdef _WIN32
+        static bool wsa_initialized = false;
+        if (!wsa_initialized) {
+            WSADATA wsaData;
+            if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
+                throw ignite_error("WSAStartup failed");
+            }
+            wsa_initialized = true;
+        }
+#endif
+    }
 
     ~fake_server() {
         m_stopped.store(true);
 
         if (m_started)
             m_client_channel->stop();
 
-        if (m_srv_fd > 0) {
-            ::close(m_srv_fd);
+        if (m_srv_sock.is_valid()) {
+            m_srv_sock.close();
         }
-
         m_io_thread->join();
+
+#ifdef _WIN32
+        WSACleanup();
+#endif

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to