| 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 | { |
no outgoing calls
no test coverage detected