mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
Avoid infinite loop waiting for DNS resolution.
This commit is contained in:
parent
77381ac494
commit
e6d47c58f7
1 changed files with 8 additions and 16 deletions
|
|
@ -48,13 +48,15 @@ TEST(Net, TCPRequest)
|
||||||
|
|
||||||
Net::Error e = Net::sendtoSocket(mSocket, reqBuffer, sizeof(reqBuffer));
|
Net::Error e = Net::sendtoSocket(mSocket, reqBuffer, sizeof(reqBuffer));
|
||||||
|
|
||||||
EXPECT_EQ(e, Net::NoError)
|
ASSERT_EQ(Net::NoError, e)
|
||||||
<< "Got an error sending our HTTP request!";
|
<< "Got an error sending our HTTP request!";
|
||||||
}
|
}
|
||||||
else if(state == Net::Disconnected)
|
else
|
||||||
{
|
{
|
||||||
Process::requestShutdown();
|
Process::requestShutdown();
|
||||||
mSocket = NULL;
|
mSocket = NULL;
|
||||||
|
ASSERT_EQ(Net::Disconnected, state)
|
||||||
|
<< "Ended with a network error!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -64,10 +66,6 @@ TEST(Net, TCPRequest)
|
||||||
if(mSocket != sock)
|
if(mSocket != sock)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char buff[4096];
|
|
||||||
dMemcpy(buff, incomingData.data, incomingData.size);
|
|
||||||
buff[incomingData.size] = 0;
|
|
||||||
|
|
||||||
mDataReceived += incomingData.size;
|
mDataReceived += incomingData.size;
|
||||||
}
|
}
|
||||||
} handler;
|
} handler;
|
||||||
|
|
@ -115,13 +113,15 @@ TEST(Net, JournalTCPRequest)
|
||||||
|
|
||||||
Net::Error e = Net::sendtoSocket(mSocket, reqBuffer, sizeof(reqBuffer));
|
Net::Error e = Net::sendtoSocket(mSocket, reqBuffer, sizeof(reqBuffer));
|
||||||
|
|
||||||
EXPECT_EQ(e, Net::NoError)
|
ASSERT_EQ(Net::NoError, e)
|
||||||
<< "Got an error sending our HTTP request!";
|
<< "Got an error sending our HTTP request!";
|
||||||
}
|
}
|
||||||
else if(state == Net::Disconnected)
|
else
|
||||||
{
|
{
|
||||||
Process::requestShutdown();
|
Process::requestShutdown();
|
||||||
mSocket = NULL;
|
mSocket = NULL;
|
||||||
|
ASSERT_EQ(Net::Disconnected, state)
|
||||||
|
<< "Ended with a network error!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -130,11 +130,6 @@ TEST(Net, JournalTCPRequest)
|
||||||
// Only consider our own socket.
|
// Only consider our own socket.
|
||||||
if(mSocket != sock)
|
if(mSocket != sock)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char buff[4096];
|
|
||||||
dMemcpy(buff, incomingData.data, incomingData.size);
|
|
||||||
buff[incomingData.size] = 0;
|
|
||||||
|
|
||||||
mDataReceived += incomingData.size;
|
mDataReceived += incomingData.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -143,9 +138,6 @@ TEST(Net, JournalTCPRequest)
|
||||||
mSocket = InvalidSocket;
|
mSocket = InvalidSocket;
|
||||||
mDataReceived = 0;
|
mDataReceived = 0;
|
||||||
|
|
||||||
// Initialize networking - done by initLibraries currently
|
|
||||||
//test(Net::init(), "Failed to initialize networking!");
|
|
||||||
|
|
||||||
// Hook into the signals.
|
// Hook into the signals.
|
||||||
Net::smConnectionNotify. notify(this, &handle::notify);
|
Net::smConnectionNotify. notify(this, &handle::notify);
|
||||||
Net::smConnectionReceive.notify(this, &handle::receive);
|
Net::smConnectionReceive.notify(this, &handle::receive);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue