So I go to make the latest build with trivial changes from what I was using before, and all of a sudden this crops up. When the server starts, I get the assertion failure -- last one in this function:
int InitUDP (void)
{
u_long ioctlflags = 1;
struct sockaddr_in claddress;
#ifdef WIN32
if (WSAStartup(MAKEWORD(1, 1), &g_winsockdata)) // todo: does linux need any special initialization?
{
assert(0);
}
#endif
hash_table_init(&g_hash_address, 0xff, gi.TagFree); // 1.902
memset(&claddress, 0, sizeof(claddress));
if ((g_socket = socket(AF_INET, SOCK_DGRAM, 0)) < 0) // UDP
{
assert(0);
return -1;
}
if (ioctlsocket(g_socket, FIONBIO, &ioctlflags) < 0) // make it non-blocking
{
assert(0);
}
claddress.sin_family = AF_INET;
claddress.sin_port = (rand() % 10000) + 6000;
claddress.sin_addr.s_addr = INADDR_ANY;
if (bind(g_socket, (const struct sockaddr *)&claddress, sizeof(claddress)) < 0)
{
claddress.sin_port = PORT_ANY;
if (bind(g_socket, (const struct sockaddr *)&claddress, sizeof(claddress)) < 0)
{
assert(0);
}
}
return 0;
}
I thought maybe something was sucking up all the ports, but a quick lsof showed that wasn't the case, and I could still get it to work with the old executable. The weird thing is, on my laptop, it works fine. I even tried uploading the code and compiling. About the only thing that changed was fixing the mapinfo files closing.