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

Method notify

Engine/source/platform/test/netTest.cpp:33–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 S32 mDataReceived;
32
33 void notify(NetSocket sock, U32 state)
34 {
35 // Only consider our own socket.
36 if(mSocket != sock)
37 return;
38
39 // Ok - what's the state? We do some dumb responses to given states
40 // in order to fulfill the request.
41 if(state == Net::Connected)
42 {
43 U8 reqBuffer[] = {
44 "GET / HTTP/1.0\nUser-Agent: Torque/1.0\n\n"
45 };
46
47 Net::Error e = Net::sendtoSocket(mSocket, reqBuffer, sizeof(reqBuffer));
48
49 ASSERT_EQ(Net::NoError, e)
50 << "Got an error sending our HTTP request!";
51 }
52 else
53 {
54 Process::requestShutdown();
55 mSocket = NetSocket::INVALID;
56 ASSERT_EQ(Net::Disconnected, state)
57 << "Ended with a network error!";
58 }
59 }
60
61 void receive(NetSocket sock, RawData incomingData)
62 {

Callers 7

onAddMethod · 0.45
PostEffectManagerMethod · 0.45
TESTFunction · 0.45
makeRequestMethod · 0.45
TESTFunction · 0.45
OculusVRDeviceMethod · 0.45
OpenVRProviderMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected