@@ -547,6 +547,12 @@ int modbus_tcp_pi_listen(modbus_t *ctx, int nb_connection)
ctx_tcp_pi = ctx->backend_data;
+#ifdef OS_WIN32
+ if (modbustcp_init_win32() == -1) {
+ return -1;
+ }
+#endif
+
if (ctx_tcp_pi->node[0] == 0)
node = NULL; /* == any */
else