if (ioctl(lhnetsocket->inetsocket, FIONBIO, &_true) != -1)
#endif
{
- socklen_t namelen = address->addresstype == LHNETADDRESSTYPE_INET6 ? sizeof(lhnetsocket->address.addressdata.inet6) : sizeof(lhnetsocket->address.addressdata.inet4);
+#ifdef WIN32
+ int namelen;
+#else
+ socklen_t namelen;
+#endif
+ namelen = address->addresstype == LHNETADDRESSTYPE_INET6 ? sizeof(lhnetsocket->address.addressdata.inet6) : sizeof(lhnetsocket->address.addressdata.inet4);
if (bind(lhnetsocket->inetsocket, (void *)&lhnetsocket->address.addressdata, namelen) != -1)
{
getsockname(lhnetsocket->inetsocket, (void *)&lhnetsocket->address.addressdata, &namelen);
continue;
}
#ifndef STANDALONETEST
- if (p->sentdoubletime && Sys_DoubleTime() < p->sentdoubletime)
+ if (cl_netlocalping.value && (Sys_DoubleTime() - cl_netlocalping.value * 1000.0) < p->sentdoubletime)
continue;
#endif
if (value == 0 && p->destinationport == lhnetsocket->address.addressdata.loop.port)
p->next->prev = p;
p->prev->next = p;
#ifndef STANDALONETEST
- if (cl_netlocalping_min.value || cl_netlocalping_max.value)
- p->sentdoubletime = Sys_DoubleTime() + lhrandom(cl_netlocalping_min.value, cl_netlocalping_max.value) * (0.5 / 1000.0);
+ p->sentdoubletime = Sys_DoubleTime();
#endif
value = contentlength;
}