MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / TEST

Function TEST

Engine/source/platform/test/netTest.cpp:71–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69};
70
71TEST(Net, TCPRequest)
72{
73 TcpHandle handler;
74
75 handler.mSocket = NetSocket::INVALID;
76 handler.mDataReceived = 0;
77
78 // Hook into the signals.
79 Net::smConnectionNotify ->notify(&handler, &TcpHandle::notify);
80 Net::smConnectionReceive->notify(&handler, &TcpHandle::receive);
81
82 // Open a TCP connection to garagegames.com
83 handler.mSocket = Net::openConnectTo("72.246.107.193:80");
84 const U32 limit = Platform::getRealMilliseconds() + (5*1000);
85 while(Process::processEvents() && (Platform::getRealMilliseconds() < limit) ) {}
86
87 // Unhook from the signals.
88 Net::smConnectionNotify ->remove(&handler, &TcpHandle::notify);
89 Net::smConnectionReceive->remove(&handler, &TcpHandle::receive);
90
91 EXPECT_GT(handler.mDataReceived, 0)
92 << "Didn't get any data back!";
93}
94
95struct JournalHandle
96{

Callers

nothing calls this directly

Calls 4

IsRecordingFunction · 0.85
makeRequestMethod · 0.80
notifyMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected