#define CATTA_RR_HOLDOFF_MSEC_RATE_LIMIT 20000
#define CATTA_RR_RATE_LIMIT_COUNT 15
+#ifndef _WIN32
+#define closesocket close
+#endif
+
typedef struct CattaLegacyUnicastReflectSlot CattaLegacyUnicastReflectSlot;
struct CattaLegacyUnicastReflectSlot {
/* Free sockets */
if (s->fd_ipv4 >= 0)
- close(s->fd_ipv4);
+ closesocket(s->fd_ipv4);
if (s->fd_ipv6 >= 0)
- close(s->fd_ipv6);
+ closesocket(s->fd_ipv6);
if (s->fd_legacy_unicast_ipv4 >= 0)
- close(s->fd_legacy_unicast_ipv4);
+ closesocket(s->fd_legacy_unicast_ipv4);
if (s->fd_legacy_unicast_ipv6 >= 0)
- close(s->fd_legacy_unicast_ipv6);
+ closesocket(s->fd_legacy_unicast_ipv6);
/* Free other stuff */
fail:
if (fd >= 0)
- close(fd);
+ closesocket(fd);
return -1;
}
fail:
if (fd >= 0)
- close(fd);
+ closesocket(fd);
return -1;
}
fail:
if (fd >= 0)
- close(fd);
+ closesocket(fd);
return -1;
}
fail:
if (fd >= 0)
- close(fd);
+ closesocket(fd);
return -1;
}
catta_log_error(__FILE__": Failed to create wide area sockets: %s", strerror(errno));
if (e->fd_ipv6 >= 0)
- close(e->fd_ipv6);
+ closesocket(e->fd_ipv6);
if (e->fd_ipv4 >= 0)
- close(e->fd_ipv4);
+ closesocket(e->fd_ipv4);
catta_free(e);
return NULL;
e->server->poll_api->watch_free(e->watch_ipv6);
if (e->fd_ipv6 >= 0)
- close(e->fd_ipv6);
+ closesocket(e->fd_ipv6);
if (e->fd_ipv4 >= 0)
- close(e->fd_ipv4);
+ closesocket(e->fd_ipv4);
catta_free(e);
}