소스 검색

Fix TCP PI init under Windows

Thanks to oldfaber
Stéphane Raimbault 13 년 전
부모
커밋
be4b215d9e
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      src/modbus-tcp.c

+ 6 - 0
src/modbus-tcp.c

@@ -328,6 +328,12 @@ static int _modbus_tcp_pi_connect(modbus_t *ctx)
     struct addrinfo ai_hints;
     modbus_tcp_pi_t *ctx_tcp_pi = ctx->backend_data;
 
+#ifdef OS_WIN32
+    if (_modbus_tcp_init_win32() == -1) {
+        return -1;
+    }
+#endif
+
     memset(&ai_hints, 0, sizeof(ai_hints));
 #ifdef AI_ADDRCONFIG
     ai_hints.ai_flags |= AI_ADDRCONFIG;