diff --git a/src/modbus-tcp.c b/src/modbus-tcp.c index c304441..c228c16 100644 --- a/src/modbus-tcp.c +++ b/src/modbus-tcp.c @@ -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