mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +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));
|
||||
|
||||
EXPECT_EQ(e, Net::NoError)
|
||||
ASSERT_EQ(Net::NoError, e)
|
||||
<< "Got an error sending our HTTP request!";
|
||||
}
|
||||
else if(state == Net::Disconnected)
|
||||
else
|
||||
{
|
||||
Process::requestShutdown();
|
||||
mSocket = NULL;
|
||||
ASSERT_EQ(Net::Disconnected, state)
|
||||
<< "Ended with a network error!";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -64,10 +66,6 @@ TEST(Net, TCPRequest)
|
|||
if(mSocket != sock)
|
||||
return;
|
||||
|
||||
char buff[4096];
|
||||
dMemcpy(buff, incomingData.data, incomingData.size);
|
||||
buff[incomingData.size] = 0;
|
||||
|
||||
mDataReceived += incomingData.size;
|
||||
}
|
||||
} handler;
|
||||
|
|
@ -115,13 +113,15 @@ TEST(Net, JournalTCPRequest)
|
|||
|
||||
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!";
|
||||
}
|
||||
else if(state == Net::Disconnected)
|
||||
else
|
||||
{
|
||||
Process::requestShutdown();
|
||||
mSocket = NULL;
|
||||
ASSERT_EQ(Net::Disconnected, state)
|
||||
<< "Ended with a network error!";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -130,11 +130,6 @@ TEST(Net, JournalTCPRequest)
|
|||
// Only consider our own socket.
|
||||
if(mSocket != sock)
|
||||
return;
|
||||
|
||||
char buff[4096];
|
||||
dMemcpy(buff, incomingData.data, incomingData.size);
|
||||
buff[incomingData.size] = 0;
|
||||
|
||||
mDataReceived += incomingData.size;
|
||||
}
|
||||
|
||||
|
|
@ -143,9 +138,6 @@ TEST(Net, JournalTCPRequest)
|
|||
mSocket = InvalidSocket;
|
||||
mDataReceived = 0;
|
||||
|
||||
// Initialize networking - done by initLibraries currently
|
||||
//test(Net::init(), "Failed to initialize networking!");
|
||||
|
||||
// Hook into the signals.
|
||||
Net::smConnectionNotify. notify(this, &handle::notify);
|
||||
Net::smConnectionReceive.notify(this, &handle::receive);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue